]> granicus.if.org Git - clang/commitdiff
clang/test: Introduce the feature "rewriter" for --enable-clang-rewriter.
authorNAKAMURA Takumi <geek4civic@gmail.com>
Wed, 16 Jul 2014 13:36:39 +0000 (13:36 +0000)
committerNAKAMURA Takumi <geek4civic@gmail.com>
Wed, 16 Jul 2014 13:36:39 +0000 (13:36 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@213148 91177308-0d34-0410-b5e6-96231b3b80d8

23 files changed:
test/CXX/basic/basic.start/basic.start.main/p2.cpp
test/CXX/temp/temp.spec/cxx1y-variable-template-no-body.cpp
test/CXX/temp/temp.spec/no-body.cpp
test/Coverage/html-print.c
test/Format/lit.local.cfg [new file with mode: 0644]
test/Frontend/Rewriter/lit.local.cfg [new file with mode: 0644]
test/Misc/emit-html-insert.c
test/Misc/emit-html.c
test/Parser/brackets.c
test/Parser/brackets.cpp
test/Parser/colon-colon-parentheses.cpp
test/Parser/cxx-extra-semi.cpp
test/Parser/nested-namespaces-recovery.cpp
test/Preprocessor/ignore-pragmas.c
test/Sema/format-strings-fixit-ssize_t.c
test/Sema/format-strings-fixit.c
test/Sema/format-strings-no-fixit.c
test/Sema/warn-documentation-almost-trailing.c
test/Sema/warn-strncat-size.c
test/SemaCXX/delete.cpp
test/SemaObjC/cocoa-api-usage.m
test/SemaObjC/cocoa-api-usage.m.fixed
test/lit.cfg

index 42e87e5431f2a5ba056416ca994d510f4224dc86..b3e171fbdb99cbd741d59406732f42bc7e50df1b 100644 (file)
@@ -10,6 +10,7 @@
 // RUN: cp %s %t
 // RUN: %clang_cc1 -x c++ %s -std=c++11 -fsyntax-only -verify -DTEST9
 // RUN: not %clang_cc1 -x c++ %t -std=c++11 -fixit -DTEST9
+// REQUIRES: rewriter
 // RUN: %clang_cc1 -x c++ %t -std=c++11 -fsyntax-only -DTEST9
 
 // RUN: %clang_cc1 -fsyntax-only -verify %s -DTEST10
index 7eb5e3744d189f1958a1c749f5452bdbfef11539..3b54a8c3a65ca54fbb4d796c320cf9a91b247667 100644 (file)
@@ -2,6 +2,7 @@
 // RUN: cp %s %t
 // RUN: not %clang_cc1 --std=c++1y -x c++ -fixit %t -DFIXING
 // RUN: %clang_cc1 --std=c++1y -x c++ %t -DFIXING
+// REQUIRES: rewriter
 
 template<typename T> 
 T pi = T(3.1415926535897932385); // expected-note {{template is declared here}}
index 61d285b27ed28e0010abd8981d8568ae320c8360..aa2380d30bf9c5b064fd9cba0a9916050148219f 100644 (file)
@@ -2,6 +2,7 @@
 // RUN: cp %s %t
 // RUN: not %clang_cc1 -x c++ -fixit %t -DFIXING
 // RUN: %clang_cc1 -x c++ %t -DFIXING
+// REQUIRES: rewriter
 
 template<typename T> void f(T) { }
 template<typename T> void g(T) { }
index a3f29c6f36f86ff7b34333d5c2cbf7eeb3710ae4..2bbe0ad4248d2063c73cd7cfb0eb24f717a157a6 100644 (file)
@@ -1,3 +1,6 @@
 // RUN: %clang_cc1 -emit-html -o %t %s
 
+// -emit-html requires rewriter.
+// REQUIRES: rewriter
+
 #include "c-language-features.inc"
diff --git a/test/Format/lit.local.cfg b/test/Format/lit.local.cfg
new file mode 100644 (file)
index 0000000..5bbc711
--- /dev/null
@@ -0,0 +1,2 @@
+if config.root.clang_rewriter == 0:
+    config.unsupported = True
diff --git a/test/Frontend/Rewriter/lit.local.cfg b/test/Frontend/Rewriter/lit.local.cfg
new file mode 100644 (file)
index 0000000..5bbc711
--- /dev/null
@@ -0,0 +1,2 @@
+if config.root.clang_rewriter == 0:
+    config.unsupported = True
index 289c28a5c6d72b2bd7ab64b30030c9a6de76542d..fcd36525c4ae3bb797a226696d618b7378203570 100644 (file)
@@ -1,4 +1,5 @@
 // RUN: %clang_cc1 %s -emit-html -o - | grep ">&lt; 10; }"
+// REQUIRES: rewriter
 
 int a(int x) { return x
 < 10; }
index ec07a60a60668361bfcfde00fd7f177433a17208..f8042f42aed9e94913896a1286d036391f76a8aa 100644 (file)
@@ -1,4 +1,5 @@
 // RUN: %clang_cc1 %s -emit-html -o -
+// REQUIRES: rewriter
 
 // rdar://6562329
 #line 42 "foo.c"
index 2750d0e42ed81b3062288c4af4b2ceb93def1ec1..67ea423aeea884a28a810e562223859368d5a12f 100644 (file)
@@ -3,6 +3,7 @@
 // RUN: not %clang_cc1 -fixit %t -x c -DFIXIT
 // RUN: %clang_cc1 -fsyntax-only %t -x c -DFIXIT
 // RUN: not %clang_cc1 -fsyntax-only -fdiagnostics-parseable-fixits %s 2>&1 | FileCheck %s -strict-whitespace
+// REQUIRES: rewriter
 
 void test1() {
   int a[] = {0,1,1,2,3};
index f418c11d3ac304157518bcd58e560c543497045d..128b514b1585fc4757b40c732dcc55a44ff5675c 100644 (file)
@@ -3,6 +3,7 @@
 // RUN: not %clang_cc1 -fixit %t -x c++ -DFIXIT
 // RUN: %clang_cc1 -fsyntax-only %t -x c++ -DFIXIT
 // RUN: not %clang_cc1 -fsyntax-only -fdiagnostics-parseable-fixits %s 2>&1 | FileCheck %s -strict-whitespace
+// REQUIRES: rewriter
 
 void test1() {
   int a[] = {0,1,1,2,3};
index 55948fdb0051cdf3521e8383129e8d1f4a43244c..dc9aa7a0c9eddb8ee534b8db17b2e45abf925905 100644 (file)
@@ -2,6 +2,7 @@
 // RUN: cp %s %t
 // RUN: not %clang_cc1 -x c++ -fixit %t
 // RUN: %clang_cc1 -x c++ %t
+// REQUIRES: rewriter
 
 struct S { static int a,b,c;};
 int S::(a);  // expected-error{{unexpected parenthesis after '::'}}
index 2aa18dfcc0e4e76920fa04a9af7d661645f0eba6..1bc0a82b2d7792426905e65e3f70c21bc53aeb3f 100644 (file)
@@ -4,6 +4,7 @@
 // RUN: cp %s %t
 // RUN: %clang_cc1 -x c++ -Wextra-semi -fixit %t
 // RUN: %clang_cc1 -x c++ -Wextra-semi -Werror %t
+// REQUIRES: rewriter
 
 class A {
   void A1();
index d45938bb3e674af02e00e14a92fff4fc43c1fd2c..f751180c96de760265587b17fe24e38fd7d0f2bb 100644 (file)
@@ -2,6 +2,7 @@
 // RUN: %clang_cc1 -fsyntax-only -verify %s
 // RUN: not %clang_cc1 -x c++ -fixit %t
 // RUN: %clang_cc1 -x c++ %t
+// REQUIRES: rewriter
 
 namespace foo1::foo2::foo3 { // expected-error {{nested namespace definition must define each namespace separately}}
   int foo(int x) { return x; }
index e2f9ef3dfa346538ebd2c02be962878f4b95e0d8..3226d536f84969c0343e20f2069afff0dc018c6b 100644 (file)
@@ -3,6 +3,7 @@
 // RUN: %clang -M -Wall %s -Xclang -verify
 // RUN: %clang -E -frewrite-includes %s -Wall -Xclang -verify
 // RUN: %clang -E -dD -dM %s -Wall -Xclang -verify
+// REQUIRES: rewriter
 // expected-no-diagnostics
 
 #pragma GCC visibility push (default)
index 5208a294a4802a4843a86fbf760198c26b808dfb..6e8e49bf97e752dd64cf6c17948bb67cb94d7a77 100644 (file)
@@ -2,6 +2,7 @@
 // RUN: %clang_cc1 -triple x86_64-apple-darwin10 -pedantic -Wall -fixit %t
 // RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fsyntax-only -pedantic -Wall -Werror %t
 // RUN: %clang_cc1 -triple x86_64-apple-darwin10 -E -o - %t | FileCheck %s
+// REQUIRES: rewriter
 
 /* This is a test of the various code modification hints that are
    provided as part of warning or extension diagnostics. All of the
index b982eb45e5f930aea025d598fbdbc39a594dd2af..098c7e05cad9761687b339d2ad8954604b775172 100644 (file)
@@ -2,6 +2,7 @@
 // RUN: %clang_cc1 -pedantic -Wall -fixit %t
 // RUN: %clang_cc1 -fsyntax-only -pedantic -Wall -Werror %t
 // RUN: %clang_cc1 -E -o - %t | FileCheck %s
+// REQUIRES: rewriter
 
 /* This is a test of the various code modification hints that are
    provided as part of warning or extension diagnostics. All of the
index 701e945f69021a00d51907f44a3f4da4e5edf79b..7371fde735cf8cf2130565f8d860f31a2df59529 100644 (file)
@@ -1,6 +1,7 @@
 // RUN: cp %s %t
 // RUN: %clang_cc1 -fsyntax-only -fixit %t
 // RUN: %clang_cc1 -E -o - %t | FileCheck %s
+// REQUIRES: rewriter
 
 /* This is a test of the various code modification hints that are
    provided as part of warning or extension diagnostics. Only
index 9ff71a3bce3646715e2d90d222f029c8f365caf9..e3dee2977a9ba08cf3c6a083c0d162ed211c16e8 100644 (file)
@@ -3,6 +3,7 @@
 // RUN: cp %s %t
 // RUN: %clang_cc1 -fsyntax-only -Wdocumentation -fixit %t
 // RUN: %clang_cc1 -fsyntax-only -Wdocumentation -Werror %t
+// REQUIRES: rewriter
 
 struct a {
   int x; //< comment // expected-warning {{not a Doxygen trailing comment}}
index dcc3367e94993693e90352ea50e9c63639bf4865..0b74b21d583c32b0a09c79cd5a734c93ee84f12e 100644 (file)
@@ -2,6 +2,7 @@
 // RUN: %clang_cc1 -DUSE_BUILTINS -Wstrncat-size -verify -fsyntax-only %s
 // RUN: %clang_cc1 -fsyntax-only -Wstrncat-size -fixit -x c %s
 // RUN: %clang_cc1 -DUSE_BUILTINS -fsyntax-only -Wstrncat-size -fixit -x c %s
+// REQUIRES: rewriter
 
 typedef __SIZE_TYPE__ size_t;
 size_t strlen (const char *s);
index 5824facc507b156a714d798ed5c1614c248791ed..6afdaf1d3aae8645e344d6a2328809ac87bb8089 100644 (file)
@@ -2,6 +2,7 @@
 // RUN: cp %s %t
 // RUN: %clang_cc1 -fixit -x c++ %t
 // RUN: %clang_cc1 -E -o - %t | FileCheck %s
+// REQUIRES: rewriter
 
 void f(int a[10][20]) {
   // CHECK: delete[] a;
index bed7ecde06011f082a2d98bf89cc28643fb1ab96..9e287bf825ab0e9980b1fbd8e6098ceb27a4523c 100644 (file)
@@ -3,6 +3,7 @@
 // RUN: cp %s %t.m
 // RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fobjc-arc %t.m -fixit -Wobjc-cocoa-api
 // RUN: diff %s.fixed %t.m
+// REQUIRES: rewriter
 
 typedef signed char BOOL;
 #define nil ((void*) 0)
index f472cf1a3043348c28c42d44f14bd59349cd827b..a27e4ee6db1363764722b65d83a2944fdd776663 100644 (file)
@@ -3,6 +3,7 @@
 // RUN: cp %s %t.m
 // RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fobjc-arc %t.m -fixit -Wobjc-cocoa-api
 // RUN: diff %s.fixed %t.m
+// REQUIRES: rewriter
 
 typedef signed char BOOL;
 #define nil ((void*) 0)
index b5c5628a5806b1451c72d2aeb23d3c1f19c57234..bbc5c99cdf2f3d8a7eaadc0f924e00083ccd0ed2 100644 (file)
@@ -335,6 +335,9 @@ for pattern in [r"\bFileCheck\b",
 # Set available features we allow tests to conditionalize on.
 #
 # Enabled/disabled features
+if config.clang_rewriter != 0:
+    config.available_features.add("rewriter")
+
 if config.clang_staticanalyzer != 0:
     config.available_features.add("staticanalyzer")