]> granicus.if.org Git - clang/commitdiff
Fix tests that weren't actually verifying anything.
authorDavid Blaikie <dblaikie@gmail.com>
Sun, 15 Apr 2012 22:09:44 +0000 (22:09 +0000)
committerDavid Blaikie <dblaikie@gmail.com>
Sun, 15 Apr 2012 22:09:44 +0000 (22:09 +0000)
Passing -verify to clang without -cc1 or -Xclang silently passes (with a
printed warning, but lit doesn't care about that). This change adds -cc1 or,
as is necessary in one case, -Xclang to fix this so that these tests are
actually verifying as intended.

I'd like to change the driver so this kind of mistake could not be made, but
I'm not entirely sure how. Further, since the driver only warns about unknown
flags in general, we could have similar bugs with a misspellings of arguments
that would be nice to find.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154776 91177308-0d34-0410-b5e6-96231b3b80d8

test/Analysis/objc-bool.m
test/Headers/typedef_guards.c
test/Lexer/utf-16.c
test/Preprocessor/pragma_sysheader.c
test/Sema/surpress-deprecated.c
test/SemaCXX/warn-everthing.cpp

index 631cd2d1fb21fe7e7e452012c83df8575830e168..f95736a6df51d453e618af92e2922b62c810c906 100644 (file)
@@ -1,4 +1,4 @@
-// RUN: %clang --analyze %s -o %t -verify
+// RUN: %clang --analyze %s -o %t -Xclang -verify
 
 // Test handling of ObjC bool literals.
 
index 1aa667bb7e0410ee1265ca2eb15175e9ba60a610..646b2ca0efe8105c585986729c6a7f55352fd74c 100644 (file)
@@ -1,4 +1,4 @@
-// RUN: %clang -fsyntax-only -verify %s
+// RUN: %clang_cc1 -fsyntax-only -verify %s
 
 // NULL is rdefined in stddef.h
 #define NULL ((void*) 0)
index 2b313e49fd2deb477f06bbc4629bbb9f87fe9ec2..169ee43ebe048e6aa53cd9787013aefc816c21b5 100644 (file)
@@ -1,4 +1,4 @@
-// RUN: not %clang %s -fsyntax-only -verify
+// RUN: %clang_cc1 %s -fsyntax-only -verify
 // rdar://7876588
 
 // This test verifies that clang gives a decent error for UTF-16 source files.
index 26416827c01bfaf238bd58eb8ab54b2a7d2ff6e0..17080fec53db82fed5f8b76e135fe5de218088df 100644 (file)
@@ -1,4 +1,4 @@
-// RUN: %clang -verify -pedantic %s -fsyntax-only
+// RUN: %clang_cc1 -verify -pedantic %s -fsyntax-only
 // RUN: %clang_cc1 -E %s | FileCheck %s
 // rdar://6899937
 #include "pragma_sysheader.h"
index 78faf22328a43ba10b1290f366010228f534a022..dd673b9646ea30317d6be4d442c357e06a748e01 100644 (file)
@@ -1,4 +1,4 @@
-// RUN: %clang -fsyntax-only -Wno-deprecated-declarations -verify %s
+// RUN: %clang_cc1 -fsyntax-only -Wno-deprecated-declarations -verify %s
 extern void OldFunction() __attribute__((deprecated));
 
 int main (int argc, const char * argv[]) {
index 144a8f90df222c626ff25892ade956a09939c90c..ad3dd8a24d88ffc10885f323ef3ad975e785d02b 100644 (file)
@@ -1,4 +1,4 @@
-// RUN: %clang -Weverything -fsyntax-only %s -verify
+// RUN: %clang_cc1 -Weverything -fsyntax-only %s -verify
 
 // This previously crashed due to a bug in the CFG.  Exercising all
 // warnings helps check CFG construction.
@@ -8,6 +8,6 @@ public:
   ~PR12271();
 };
 
-void testPR12271() {
-  PR12271 a[1][1];
-}
\ No newline at end of file
+void testPR12271() { // expected-warning {{no previous prototype for function 'testPR12271'}}
+  PR12271 a[1][1]; // expected-warning {{unused variable 'a'}}
+}