From: NAKAMURA Takumi Date: Wed, 16 Jul 2014 13:36:39 +0000 (+0000) Subject: clang/test: Introduce the feature "rewriter" for --enable-clang-rewriter. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=47f74a049269258a710307b1ffa2a20c1035fe90;p=clang clang/test: Introduce the feature "rewriter" for --enable-clang-rewriter. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@213148 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/test/CXX/basic/basic.start/basic.start.main/p2.cpp b/test/CXX/basic/basic.start/basic.start.main/p2.cpp index 42e87e5431..b3e171fbdb 100644 --- a/test/CXX/basic/basic.start/basic.start.main/p2.cpp +++ b/test/CXX/basic/basic.start/basic.start.main/p2.cpp @@ -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 diff --git a/test/CXX/temp/temp.spec/cxx1y-variable-template-no-body.cpp b/test/CXX/temp/temp.spec/cxx1y-variable-template-no-body.cpp index 7eb5e3744d..3b54a8c3a6 100644 --- a/test/CXX/temp/temp.spec/cxx1y-variable-template-no-body.cpp +++ b/test/CXX/temp/temp.spec/cxx1y-variable-template-no-body.cpp @@ -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 T pi = T(3.1415926535897932385); // expected-note {{template is declared here}} diff --git a/test/CXX/temp/temp.spec/no-body.cpp b/test/CXX/temp/temp.spec/no-body.cpp index 61d285b27e..aa2380d30b 100644 --- a/test/CXX/temp/temp.spec/no-body.cpp +++ b/test/CXX/temp/temp.spec/no-body.cpp @@ -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 void f(T) { } template void g(T) { } diff --git a/test/Coverage/html-print.c b/test/Coverage/html-print.c index a3f29c6f36..2bbe0ad424 100644 --- a/test/Coverage/html-print.c +++ b/test/Coverage/html-print.c @@ -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 index 0000000000..5bbc711c65 --- /dev/null +++ b/test/Format/lit.local.cfg @@ -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 index 0000000000..5bbc711c65 --- /dev/null +++ b/test/Frontend/Rewriter/lit.local.cfg @@ -0,0 +1,2 @@ +if config.root.clang_rewriter == 0: + config.unsupported = True diff --git a/test/Misc/emit-html-insert.c b/test/Misc/emit-html-insert.c index 289c28a5c6..fcd36525c4 100644 --- a/test/Misc/emit-html-insert.c +++ b/test/Misc/emit-html-insert.c @@ -1,4 +1,5 @@ // RUN: %clang_cc1 %s -emit-html -o - | grep ">< 10; }" +// REQUIRES: rewriter int a(int x) { return x < 10; } diff --git a/test/Misc/emit-html.c b/test/Misc/emit-html.c index ec07a60a60..f8042f42ae 100644 --- a/test/Misc/emit-html.c +++ b/test/Misc/emit-html.c @@ -1,4 +1,5 @@ // RUN: %clang_cc1 %s -emit-html -o - +// REQUIRES: rewriter // rdar://6562329 #line 42 "foo.c" diff --git a/test/Parser/brackets.c b/test/Parser/brackets.c index 2750d0e42e..67ea423aee 100644 --- a/test/Parser/brackets.c +++ b/test/Parser/brackets.c @@ -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}; diff --git a/test/Parser/brackets.cpp b/test/Parser/brackets.cpp index f418c11d3a..128b514b15 100644 --- a/test/Parser/brackets.cpp +++ b/test/Parser/brackets.cpp @@ -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}; diff --git a/test/Parser/colon-colon-parentheses.cpp b/test/Parser/colon-colon-parentheses.cpp index 55948fdb00..dc9aa7a0c9 100644 --- a/test/Parser/colon-colon-parentheses.cpp +++ b/test/Parser/colon-colon-parentheses.cpp @@ -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 '::'}} diff --git a/test/Parser/cxx-extra-semi.cpp b/test/Parser/cxx-extra-semi.cpp index 2aa18dfcc0..1bc0a82b2d 100644 --- a/test/Parser/cxx-extra-semi.cpp +++ b/test/Parser/cxx-extra-semi.cpp @@ -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(); diff --git a/test/Parser/nested-namespaces-recovery.cpp b/test/Parser/nested-namespaces-recovery.cpp index d45938bb3e..f751180c96 100644 --- a/test/Parser/nested-namespaces-recovery.cpp +++ b/test/Parser/nested-namespaces-recovery.cpp @@ -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; } diff --git a/test/Preprocessor/ignore-pragmas.c b/test/Preprocessor/ignore-pragmas.c index e2f9ef3dfa..3226d536f8 100644 --- a/test/Preprocessor/ignore-pragmas.c +++ b/test/Preprocessor/ignore-pragmas.c @@ -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) diff --git a/test/Sema/format-strings-fixit-ssize_t.c b/test/Sema/format-strings-fixit-ssize_t.c index 5208a294a4..6e8e49bf97 100644 --- a/test/Sema/format-strings-fixit-ssize_t.c +++ b/test/Sema/format-strings-fixit-ssize_t.c @@ -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 diff --git a/test/Sema/format-strings-fixit.c b/test/Sema/format-strings-fixit.c index b982eb45e5..098c7e05ca 100644 --- a/test/Sema/format-strings-fixit.c +++ b/test/Sema/format-strings-fixit.c @@ -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 diff --git a/test/Sema/format-strings-no-fixit.c b/test/Sema/format-strings-no-fixit.c index 701e945f69..7371fde735 100644 --- a/test/Sema/format-strings-no-fixit.c +++ b/test/Sema/format-strings-no-fixit.c @@ -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 diff --git a/test/Sema/warn-documentation-almost-trailing.c b/test/Sema/warn-documentation-almost-trailing.c index 9ff71a3bce..e3dee2977a 100644 --- a/test/Sema/warn-documentation-almost-trailing.c +++ b/test/Sema/warn-documentation-almost-trailing.c @@ -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}} diff --git a/test/Sema/warn-strncat-size.c b/test/Sema/warn-strncat-size.c index dcc3367e94..0b74b21d58 100644 --- a/test/Sema/warn-strncat-size.c +++ b/test/Sema/warn-strncat-size.c @@ -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); diff --git a/test/SemaCXX/delete.cpp b/test/SemaCXX/delete.cpp index 5824facc50..6afdaf1d3a 100644 --- a/test/SemaCXX/delete.cpp +++ b/test/SemaCXX/delete.cpp @@ -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; diff --git a/test/SemaObjC/cocoa-api-usage.m b/test/SemaObjC/cocoa-api-usage.m index bed7ecde06..9e287bf825 100644 --- a/test/SemaObjC/cocoa-api-usage.m +++ b/test/SemaObjC/cocoa-api-usage.m @@ -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) diff --git a/test/SemaObjC/cocoa-api-usage.m.fixed b/test/SemaObjC/cocoa-api-usage.m.fixed index f472cf1a30..a27e4ee6db 100644 --- a/test/SemaObjC/cocoa-api-usage.m.fixed +++ b/test/SemaObjC/cocoa-api-usage.m.fixed @@ -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) diff --git a/test/lit.cfg b/test/lit.cfg index b5c5628a58..bbc5c99cdf 100644 --- a/test/lit.cfg +++ b/test/lit.cfg @@ -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")