1 // RUN: %clang_analyze_cc1 -analyzer-checker=core,debug.ExprInspection -verify %s
2 // RUN: %clang_analyze_cc1 -analyzer-checker=core,debug.ExprInspection -triple x86_64-unknown-linux -verify %s
3 // RUN: %clang_analyze_cc1 -analyzer-checker=core,debug.ExprInspection -triple powerpc64-linux-gnu -verify %s
5 #define _Complex_I (__extension__ 1.0iF)
7 void clang_analyzer_eval(int);
9 void complex_float(double _Complex x
, double _Complex y
) {
10 clang_analyzer_eval(x
== y
); // expected-warning{{UNKNOWN}}
11 if (x
!= 1.0 + 3.0 * _Complex_I
&& y
!= 1.0 - 4.0 * _Complex_I
)
13 clang_analyzer_eval(x
== y
); // expected-warning{{UNKNOWN}}
14 clang_analyzer_eval(x
+ y
== 2.0 - 1.0 * _Complex_I
); // expected-warning{{UNKNOWN}}
17 void complex_int(int _Complex x
, int _Complex y
) {
18 clang_analyzer_eval(x
== y
); // expected-warning{{UNKNOWN}}
19 if (x
!= 1.0 + 3.0 * _Complex_I
&& y
!= 1.0 - 4.0 * _Complex_I
)
21 clang_analyzer_eval(x
== y
); // expected-warning{{UNKNOWN}}
22 clang_analyzer_eval(x
+ y
== 2.0 - 1.0 * _Complex_I
); // expected-warning{{UNKNOWN}}
25 void longdouble_float(long double x
, long double y
) {
26 clang_analyzer_eval(x
== y
); // expected-warning{{UNKNOWN}}
27 if (x
!= 0.0L && y
!= 1.0L)
29 clang_analyzer_eval(x
== y
); // expected-warning{{UNKNOWN}}
30 clang_analyzer_eval(x
+ y
== 1.0L); // expected-warning{{UNKNOWN}}