aboutsummaryrefslogtreecommitdiff
path: root/clang/test/Analysis/bitint-z3.c
blob: 4cb97f9de8299a8f70ee7d2a63c0261d0a01973d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
// RUN: %clang_analyze_cc1 -analyzer-checker=core,debug.ExprInspection -w \
// RUN:   -analyzer-config crosscheck-with-z3=true -verify %s
// REQUIRES: z3

// Previously these tests were crashing because the SMTConv layer did not
// comprehend the _BitInt types.

void clang_analyzer_warnIfReached();

void c(int b, _BitInt(35) a) {
  int d = 0;
  if (a)
    b = d;
  clang_analyzer_warnIfReached(); // expected-warning{{REACHABLE}}
}

void f(int *d, _BitInt(3) e) {
  int g;
  d = &g;
  e ?: 0;
  clang_analyzer_warnIfReached(); // expected-warning{{REACHABLE}}
}