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
-// RUN: %clang --analyze %s -o %t -verify
+// RUN: %clang --analyze %s -o %t -Xclang -verify
// Test handling of ObjC bool literals.
-// RUN: %clang -fsyntax-only -verify %s
+// RUN: %clang_cc1 -fsyntax-only -verify %s
// NULL is rdefined in stddef.h
#define NULL ((void*) 0)
-// 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.
-// 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"
-// 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[]) {
-// 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.
~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'}}
+}