diff options
| author | Fariborz Jahanian <fjahanian@apple.com> | 2012-09-18 17:37:21 +0000 |
|---|---|---|
| committer | Fariborz Jahanian <fjahanian@apple.com> | 2012-09-18 17:37:21 +0000 |
| commit | b1885425c4adbb2baa09d90fe9c20d261759366e (patch) | |
| tree | e5402957b39ec681f3e3edb77fa72a1f3e8cb52f /clang/test/Analysis/additive-folding.cpp | |
| parent | a59ef5795d884d39acd471cb71ee7ba93abc5e79 (diff) | |
| download | bcm5719-llvm-b1885425c4adbb2baa09d90fe9c20d261759366e.tar.gz bcm5719-llvm-b1885425c4adbb2baa09d90fe9c20d261759366e.zip | |
c: warn when an integer value comparison with an
integral expression have the obvious result.
Patch reviewed by John McCall off line.
// rdar://12202422
llvm-svn: 164143
Diffstat (limited to 'clang/test/Analysis/additive-folding.cpp')
| -rw-r--r-- | clang/test/Analysis/additive-folding.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/clang/test/Analysis/additive-folding.cpp b/clang/test/Analysis/additive-folding.cpp index 33f3b9b2517..7355a752469 100644 --- a/clang/test/Analysis/additive-folding.cpp +++ b/clang/test/Analysis/additive-folding.cpp @@ -128,10 +128,10 @@ void tautologies(unsigned a) { // Tautologies from outside the range of the symbol void tautologiesOutside(unsigned char a) { - clang_analyzer_eval(a <= 0x100); // expected-warning{{TRUE}} - clang_analyzer_eval(a < 0x100); // expected-warning{{TRUE}} + clang_analyzer_eval(a <= 0x100); // expected-warning{{comparison of literal 256 with expression of type 'unsigned char' is always true}} expected-warning{{TRUE}} + clang_analyzer_eval(a < 0x100); // expected-warning{{comparison of literal 256 with expression of type 'unsigned char' is always true}} expected-warning{{TRUE}} - clang_analyzer_eval(a != 0x100); // expected-warning{{TRUE}} + clang_analyzer_eval(a != 0x100); // expected-warning{{comparison of literal 256 with expression of type 'unsigned char' is always true}} expected-warning{{TRUE}} clang_analyzer_eval(a != -1); // expected-warning{{TRUE}} clang_analyzer_eval(a > -1); // expected-warning{{TRUE}} |

