Bug 1814798 - pt 1. Add bool to enable/disable PHC at runtime r=glandium
[gecko.git] / build / clang-plugin / tests / TestNANTestingExpr.cpp
blob9aac46d0361701c25d74b019773130868a1c3b28
1 #line 1 "tests/SkScalar.h"
2 // This checks that the whitelist accounts for #line directives and such. If you
3 // remove SkScalar from the whitelist, please change the filename here instead
4 // of adding expected diagnostics.
5 inline int headerSays(double x) {
6 return x != x;
8 #line 9 "TestNANTestingExpr.cpp"
9 void test(bool x);
10 void foo() {
11 float f, f2;
12 typedef double mydouble;
13 mydouble d;
14 double d2;
15 test(f == f); // expected-error{{comparing a floating point value to itself for NaN checking can lead to incorrect results}} expected-note{{consider using std::isnan instead}}
16 test(d == d); // expected-error{{comparing a floating point value to itself for NaN checking can lead to incorrect results}} expected-note{{consider using std::isnan instead}}
17 test(f != f); // expected-error{{comparing a floating point value to itself for NaN checking can lead to incorrect results}} expected-note{{consider using std::isnan instead}}
18 test(d != d); // expected-error{{comparing a floating point value to itself for NaN checking can lead to incorrect results}} expected-note{{consider using std::isnan instead}}
19 test(f != d);
20 test(d == (d - f));
21 test(f == f2);
22 test(d == d2);
23 test(d + 1 == d);