diff options
author | David Blaikie <dblaikie@gmail.com> | 2012-04-15 22:09:44 +0000 |
---|---|---|
committer | David Blaikie <dblaikie@gmail.com> | 2012-04-15 22:09:44 +0000 |
commit | 030c7e9d105fdd9b5cb11b5b16c258bcb39bdac1 (patch) | |
tree | 38793fdc969bcc8eb16fa60ca1d1e75df4f00bbf | |
parent | 6c22939938d9596af43ebd456f68f8e49b42500a (diff) |
Fix tests that weren't actually verifying anything.
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
-rw-r--r-- | test/Analysis/objc-bool.m | 2 | ||||
-rw-r--r-- | test/Headers/typedef_guards.c | 2 | ||||
-rw-r--r-- | test/Lexer/utf-16.c | 2 | ||||
-rw-r--r-- | test/Preprocessor/pragma_sysheader.c | 2 | ||||
-rw-r--r-- | test/Sema/surpress-deprecated.c | 2 | ||||
-rw-r--r-- | test/SemaCXX/warn-everthing.cpp | 8 |
6 files changed, 9 insertions, 9 deletions
diff --git a/test/Analysis/objc-bool.m b/test/Analysis/objc-bool.m index 631cd2d1fb..f95736a6df 100644 --- a/test/Analysis/objc-bool.m +++ b/test/Analysis/objc-bool.m @@ -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. diff --git a/test/Headers/typedef_guards.c b/test/Headers/typedef_guards.c index 1aa667bb7e..646b2ca0ef 100644 --- a/test/Headers/typedef_guards.c +++ b/test/Headers/typedef_guards.c @@ -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) diff --git a/test/Lexer/utf-16.c b/test/Lexer/utf-16.c index 2b313e49fd..169ee43ebe 100644 --- a/test/Lexer/utf-16.c +++ b/test/Lexer/utf-16.c @@ -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. diff --git a/test/Preprocessor/pragma_sysheader.c b/test/Preprocessor/pragma_sysheader.c index 26416827c0..17080fec53 100644 --- a/test/Preprocessor/pragma_sysheader.c +++ b/test/Preprocessor/pragma_sysheader.c @@ -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" diff --git a/test/Sema/surpress-deprecated.c b/test/Sema/surpress-deprecated.c index 78faf22328..dd673b9646 100644 --- a/test/Sema/surpress-deprecated.c +++ b/test/Sema/surpress-deprecated.c @@ -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[]) { diff --git a/test/SemaCXX/warn-everthing.cpp b/test/SemaCXX/warn-everthing.cpp index 144a8f90df..ad3dd8a24d 100644 --- a/test/SemaCXX/warn-everthing.cpp +++ b/test/SemaCXX/warn-everthing.cpp @@ -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'}} +} |