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
diff --git a/test/Analysis/objc-bool.m b/test/Analysis/objc-bool.m
index 631cd2d..f95736a 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 1aa667b..646b2ca 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 2b313e4..169ee43 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 2641682..17080fe 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 78faf22..dd673b9 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 144a8f9..ad3dd8a 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 @@
~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'}}
+}