r197741 - [analyzer] Fix test in previous commit to account for compiler warning.

Jordan Rose jordan_rose at apple.com
Thu Dec 19 15:05:41 PST 2013


Author: jrose
Date: Thu Dec 19 17:05:40 2013
New Revision: 197741

URL: http://llvm.org/viewvc/llvm-project?rev=197741&view=rev
Log:
[analyzer] Fix test in previous commit to account for compiler warning.

--analyze passes -w, but -cc1 -analyze doesn't. Oops!

Modified:
    cfe/trunk/test/Analysis/casts.cpp

Modified: cfe/trunk/test/Analysis/casts.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Analysis/casts.cpp?rev=197741&r1=197740&r2=197741&view=diff
==============================================================================
--- cfe/trunk/test/Analysis/casts.cpp (original)
+++ cfe/trunk/test/Analysis/casts.cpp Thu Dec 19 17:05:40 2013
@@ -1,5 +1,4 @@
 // RUN: %clang_cc1 -analyze -analyzer-checker=core -analyzer-store=region -verify %s
-// expected-no-diagnostics
 
 bool PR14634(int x) {
   double y = (double)x;
@@ -12,8 +11,13 @@ bool PR14634_implicit(int x) {
 }
 
 void intAsBoolAsSwitchCondition(int c) {
-  switch ((bool)c) {
+  switch ((bool)c) { // expected-warning {{switch condition has boolean value}}
   case 0:
     break;
   }
+
+  switch ((int)(bool)c) { // no-warning
+    case 0:
+      break;
+  }
 }





More information about the cfe-commits mailing list