From 6749b867ad32635016177ea3a199b528d2fe88c8 Mon Sep 17 00:00:00 2001 From: Alp Toker Date: Thu, 16 Jan 2014 02:37:08 +0000 Subject: [PATCH] Forbid driver use in Sema tests This ports the last Sema tests over to use the frontend directly, and adds a local lit substitution to disable inappropriate %clang usage under this directory. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@199348 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/{Sema => Headers}/carbon.c | 0 test/Sema/lit.local.cfg | 4 ++++ test/Sema/pragma-pack-apple.c | 4 ++-- test/Sema/return.c | 2 +- test/Sema/transparent-union.c | 2 +- test/Sema/warn-missing-variable-declarations.c | 2 +- test/Sema/warn-unreachable.c | 2 +- test/Sema/wchar.c | 4 ++-- 8 files changed, 12 insertions(+), 8 deletions(-) rename test/{Sema => Headers}/carbon.c (100%) create mode 100644 test/Sema/lit.local.cfg diff --git a/test/Sema/carbon.c b/test/Headers/carbon.c similarity index 100% rename from test/Sema/carbon.c rename to test/Headers/carbon.c diff --git a/test/Sema/lit.local.cfg b/test/Sema/lit.local.cfg new file mode 100644 index 0000000000..f4ef5d2fa0 --- /dev/null +++ b/test/Sema/lit.local.cfg @@ -0,0 +1,4 @@ +config.substitutions = list(config.substitutions) +config.substitutions.insert(0, + (r'%clang\b', + """*** Do not use the driver in Sema tests. ***""") ) diff --git a/test/Sema/pragma-pack-apple.c b/test/Sema/pragma-pack-apple.c index 5b33c03c38..426d984e8a 100644 --- a/test/Sema/pragma-pack-apple.c +++ b/test/Sema/pragma-pack-apple.c @@ -1,5 +1,5 @@ -// RUN: %clang -fsyntax-only %s 2>&1 | FileCheck %s -// RUN: %clang -fsyntax-only -fapple-pragma-pack %s 2>&1 | FileCheck -check-prefix=CHECK-APPLE %s +// RUN: %clang_cc1 -fsyntax-only %s 2>&1 | FileCheck %s +// RUN: %clang_cc1 -fsyntax-only -fapple-pragma-pack %s 2>&1 | FileCheck -check-prefix=CHECK-APPLE %s #pragma pack(push,1) #pragma pack(2) diff --git a/test/Sema/return.c b/test/Sema/return.c index 7e7c8b7b84..cfdbe0c5d4 100644 --- a/test/Sema/return.c +++ b/test/Sema/return.c @@ -1,4 +1,4 @@ -// RUN: %clang %s -fsyntax-only -Wignored-qualifiers -Wno-error=return-type -Xclang -verify -fblocks -Wno-unreachable-code -Wno-unused-value +// RUN: %clang_cc1 %s -fsyntax-only -Wignored-qualifiers -Wno-error=return-type -verify -fblocks -Wno-unreachable-code -Wno-unused-value // clang emits the following warning by default. // With GCC, -pedantic, -Wreturn-type or -Wall are required to produce the diff --git a/test/Sema/transparent-union.c b/test/Sema/transparent-union.c index ab1ba1867f..bbe0a32d48 100644 --- a/test/Sema/transparent-union.c +++ b/test/Sema/transparent-union.c @@ -1,4 +1,4 @@ -// RUN: %clang -fsyntax-only -Xclang -verify %s +// RUN: %clang_cc1 -fsyntax-only -verify %s typedef union { int *ip; float *fp; diff --git a/test/Sema/warn-missing-variable-declarations.c b/test/Sema/warn-missing-variable-declarations.c index 631d3d213b..e5ce97da21 100644 --- a/test/Sema/warn-missing-variable-declarations.c +++ b/test/Sema/warn-missing-variable-declarations.c @@ -1,4 +1,4 @@ -// RUN: %clang -Wmissing-variable-declarations -fsyntax-only -Xclang -verify %s +// RUN: %clang_cc1 -Wmissing-variable-declarations -fsyntax-only -verify %s int vbad1; // expected-warning{{no previous extern declaration for non-static variable 'vbad1'}} diff --git a/test/Sema/warn-unreachable.c b/test/Sema/warn-unreachable.c index fd74b5c871..197645212d 100644 --- a/test/Sema/warn-unreachable.c +++ b/test/Sema/warn-unreachable.c @@ -1,4 +1,4 @@ -// RUN: %clang %s -fsyntax-only -Xclang -verify -fblocks -Wunreachable-code -Wno-unused-value -Wno-covered-switch-default +// RUN: %clang_cc1 %s -fsyntax-only -verify -fblocks -Wunreachable-code -Wno-unused-value -Wno-covered-switch-default int halt() __attribute__((noreturn)); int live(); diff --git a/test/Sema/wchar.c b/test/Sema/wchar.c index 13c2f5855d..74e482a2a0 100644 --- a/test/Sema/wchar.c +++ b/test/Sema/wchar.c @@ -1,5 +1,5 @@ -// RUN: %clang %s -fsyntax-only -Xclang -verify -// RUN: %clang %s -fsyntax-only -fshort-wchar -Xclang -verify -DSHORT_WCHAR +// RUN: %clang_cc1 %s -fsyntax-only -verify +// RUN: %clang_cc1 %s -fsyntax-only -fshort-wchar -verify -DSHORT_WCHAR typedef __WCHAR_TYPE__ wchar_t; -- 2.40.0