llvm-project/clang/test/Analysis/missing-z3-nocrash.c
Kristóf Umann 5048a58a67 [analyzer] Don't crash if the analyzer-constraint is set to Z3, but llvm is not built with it
Exactly what it says on the tin! We had a nasty crash with the following incovation:

$ clang --analyze -Xclang -analyzer-constraints=z3 test.c
fatal error: error in backend: LLVM was not compiled with Z3 support, rebuild with -DLLVM_ENABLE_Z3_SOLVER=ON
... <stack trace> ...

Differential Revision: https://reviews.llvm.org/D120325
2022-02-25 17:51:37 +01:00

6 lines
227 B
C

// RUN: not %clang_analyze_cc1 -analyzer-constraints=z3 %s 2>&1 | FileCheck %s
// REQUIRES: no-z3
// CHECK: error: analyzer constraint manager 'z3' is only available if LLVM
// CHECK: was built with -DLLVM_ENABLE_Z3_SOLVER=ON