[clang-cl] Ignore /Wv and /Wv:17 flags
[llvm-project.git] / clang / test / Analysis / complex.c
blobfab61bf71447f7059572dd48faa4b0f754f5715d
1 // RUN: %clang_analyze_cc1 -verify %s \
2 // RUN: -Wno-unreachable-code -ffreestanding \
3 // RUN: -analyzer-checker=core \
4 // RUN: -analyzer-checker=debug.ExprInspection
6 #include <stdint.h>
8 int clang_analyzer_eval(int);
10 void f1(int * p) {
11 // This branch should be infeasible
12 // because __imag__ p is 0.
13 if (!p && __imag__ (intptr_t) p)
14 *p = 1; // no-warning
16 // If p != 0 then this branch is feasible; otherwise it is not.
17 if (__real__ (intptr_t) p)
18 *p = 1; // no-warning
20 *p = 2; // expected-warning{{Dereference of null pointer}}
23 void complexFloat(__complex__ float f) {
24 clang_analyzer_eval(__real__(f) == 1); // expected-warning{{UNKNOWN}}
25 clang_analyzer_eval(__imag__(f) == 1); // expected-warning{{UNKNOWN}}
27 __real__(f) = 1;
28 __imag__(f) = 1;
30 clang_analyzer_eval(__real__(f) == 1); // expected-warning{{UNKNOWN}}
31 clang_analyzer_eval(__imag__(f) == 1); // expected-warning{{UNKNOWN}}
34 void complexInt(__complex__ int f) {
35 clang_analyzer_eval(__real__(f) == 1); // expected-warning{{UNKNOWN}}
36 clang_analyzer_eval(__imag__(f) == 1); // expected-warning{{UNKNOWN}}
38 __real__(f) = 1;
39 __imag__(f) = 1;
41 clang_analyzer_eval(__real__(f) == 1); // expected-warning{{UNKNOWN}}
42 clang_analyzer_eval(__imag__(f) == 1); // expected-warning{{UNKNOWN}}