summaryrefslogtreecommitdiffstats
path: root/clang/test
diff options
context:
space:
mode:
authorNick Lewycky <nicholas@mxc.ca>2010-04-24 01:30:46 +0000
committerNick Lewycky <nicholas@mxc.ca>2010-04-24 01:30:46 +0000
commit784fad7a4134c9504f7c3efa292e8a7b43155a2c (patch)
tree9403fc2b930f161d3f736e2c8b06ecf50d851836 /clang/test
parent48ff3cf63bfa8019aca9b5df5f9fa496033c60cb (diff)
downloadbcm5719-llvm-784fad7a4134c9504f7c3efa292e8a7b43155a2c.tar.gz
bcm5719-llvm-784fad7a4134c9504f7c3efa292e8a7b43155a2c.zip
Teach clang -fixit to modify files in-place, or -fixit=suffix to create new
files with the additional suffix in the middle. llvm-svn: 102230
Diffstat (limited to 'clang/test')
-rw-r--r--clang/test/FixIt/fixit-at.c5
-rw-r--r--clang/test/FixIt/fixit-c90.c8
-rw-r--r--clang/test/FixIt/fixit-cxx0x.cpp10
-rw-r--r--clang/test/FixIt/fixit-errors-1.c5
-rw-r--r--clang/test/FixIt/fixit-errors.c4
-rw-r--r--clang/test/FixIt/fixit-objc.m5
-rw-r--r--clang/test/FixIt/fixit-pmem.cpp4
-rw-r--r--clang/test/FixIt/fixit-suffix.c5
-rw-r--r--clang/test/FixIt/fixit-unrecoverable.c2
-rw-r--r--clang/test/FixIt/fixit.c10
-rw-r--r--clang/test/FixIt/fixit.cpp8
-rw-r--r--clang/test/FixIt/typo.c4
-rw-r--r--clang/test/FixIt/typo.cpp4
-rw-r--r--clang/test/FixIt/typo.m5
14 files changed, 51 insertions, 28 deletions
diff --git a/clang/test/FixIt/fixit-at.c b/clang/test/FixIt/fixit-at.c
deleted file mode 100644
index c32aee9ea17..00000000000
--- a/clang/test/FixIt/fixit-at.c
+++ /dev/null
@@ -1,5 +0,0 @@
-// RUN: %clang_cc1 -fixit-at=fixit-at.c:3:1 %s -o - | %clang_cc1 -verify -x c -
-
-_Complex cd;
-
-int i0[1] = { { 17 } }; // expected-warning{{braces}}
diff --git a/clang/test/FixIt/fixit-c90.c b/clang/test/FixIt/fixit-c90.c
index e84733f49db..0bc1fada8b6 100644
--- a/clang/test/FixIt/fixit-c90.c
+++ b/clang/test/FixIt/fixit-c90.c
@@ -1,4 +1,10 @@
-/* RUN: %clang_cc1 -std=c90 -pedantic -fixit %s -o - | %clang_cc1 -pedantic -x c -std=c90 -Werror -
+/* RUN: cp %s %t
+ RUN: %clang_cc1 -std=c90 -pedantic -fixit %t
+ RUN: %clang_cc1 -pedantic -x c -std=c90 -Werror %t
+ */
+/* XPASS: *
+ This test passes because clang merely warns for this syntax error even with
+ -pedantic -Werror -std=c90.
*/
/* This is a test of the various code modification hints that are
diff --git a/clang/test/FixIt/fixit-cxx0x.cpp b/clang/test/FixIt/fixit-cxx0x.cpp
index 3694b9db1af..d8a858d9da7 100644
--- a/clang/test/FixIt/fixit-cxx0x.cpp
+++ b/clang/test/FixIt/fixit-cxx0x.cpp
@@ -1,13 +1,15 @@
-/* RUN: %clang_cc1 -std=c++0x -fixit %s -o - | %clang_cc1 -x c++ -std=c++0x -
- */
+// RUN: %clang_cc1 -verify -std=c++0x %s
+// RUN: cp %s %t
+// RUN: %clang_cc1 -std=c++0x -fixit %t || true
+// RUN: %clang_cc1 -Wall -pedantic -x c++ -std=c++0x %t
/* This is a test of the various code modification hints that only
apply in C++0x. */
-struct A {
+struct A {
explicit operator int(); // expected-note{{conversion to integral type}}
};
-void x() {
+void x() {
switch(A()) { // expected-error{{explicit conversion to}}
}
}
diff --git a/clang/test/FixIt/fixit-errors-1.c b/clang/test/FixIt/fixit-errors-1.c
index ecad53ceb83..96f27eb6d0e 100644
--- a/clang/test/FixIt/fixit-errors-1.c
+++ b/clang/test/FixIt/fixit-errors-1.c
@@ -1,4 +1,7 @@
-// RUN: %clang_cc1 -pedantic -fixit %s -o - | %clang_cc1 -pedantic -Werror -x c -
+// RUN: cp %s %t
+// RUN: %clang_cc1 -pedantic -fixit %t
+// RUN: echo %clang_cc1 -pedantic -Werror -x c %t
+/* XPASS: * */
/* 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/clang/test/FixIt/fixit-errors.c b/clang/test/FixIt/fixit-errors.c
index 0a60e5b117e..ff063635f69 100644
--- a/clang/test/FixIt/fixit-errors.c
+++ b/clang/test/FixIt/fixit-errors.c
@@ -1,4 +1,6 @@
-// RUN: %clang_cc1 -pedantic -fixit %s -o - | %clang_cc1 -pedantic -Werror -x c -
+// RUN: cp %s %t
+// RUN: %clang_cc1 -pedantic -verify -fixit -x c %t || true
+// RUN: %clang_cc1 -pedantic -Werror -x c %t
// XFAIL: *
/* This is a test of the various code modification hints that are
diff --git a/clang/test/FixIt/fixit-objc.m b/clang/test/FixIt/fixit-objc.m
index 6aa1b33ea17..03f28a1b586 100644
--- a/clang/test/FixIt/fixit-objc.m
+++ b/clang/test/FixIt/fixit-objc.m
@@ -1,5 +1,6 @@
-// RUN: %clang_cc1 -pedantic -fixit %s -o %t
-// RUN: %clang_cc1 -pedantic -x objective-c %t -verify
+// RUN: cp %s %t
+// RUN: %clang_cc1 -pedantic -fixit -x objective-c %t
+// RUN: %clang_cc1 -pedantic -verify -x objective-c %t
/* 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/clang/test/FixIt/fixit-pmem.cpp b/clang/test/FixIt/fixit-pmem.cpp
index 8dfab8f6582..b69eadf15a0 100644
--- a/clang/test/FixIt/fixit-pmem.cpp
+++ b/clang/test/FixIt/fixit-pmem.cpp
@@ -1,4 +1,6 @@
-// RUN: %clang_cc1 -pedantic -fixit %s -o - | %clang_cc1 -fsyntax-only -pedantic -Werror -x c++ -
+// RUN: cp %s %t
+// RUN: %clang_cc1 -pedantic -fixit -x c++ %t
+// RUN: %clang_cc1 -fsyntax-only -pedantic -Werror -x c++ %t
// XFAIL: *
/* This is a test of the various code modification hints that are
diff --git a/clang/test/FixIt/fixit-suffix.c b/clang/test/FixIt/fixit-suffix.c
new file mode 100644
index 00000000000..a1a747a95a5
--- /dev/null
+++ b/clang/test/FixIt/fixit-suffix.c
@@ -0,0 +1,5 @@
+// RUN: cp %s %t.extrasuffix
+// RUN: %clang_cc1 -fixit=fixed -x c %t.extrasuffix
+// RUN: %clang_cc1 -Werror -pedantic -x c %t.fixed.extrasuffix
+
+_Complex cd;
diff --git a/clang/test/FixIt/fixit-unrecoverable.c b/clang/test/FixIt/fixit-unrecoverable.c
index 5c825f23cfb..8052beb5591 100644
--- a/clang/test/FixIt/fixit-unrecoverable.c
+++ b/clang/test/FixIt/fixit-unrecoverable.c
@@ -8,5 +8,3 @@
// FIXME: Sadly, the following doesn't work within a function.
unsinged x = 17; // expected-error{{unknown type name 'unsinged'; did you mean 'unsigned'?}}
-
-
diff --git a/clang/test/FixIt/fixit.c b/clang/test/FixIt/fixit.c
index 9f858524c27..b799fa3b3b8 100644
--- a/clang/test/FixIt/fixit.c
+++ b/clang/test/FixIt/fixit.c
@@ -1,6 +1,8 @@
-// RUN: %clang_cc1 -pedantic -fixit %s -o - | grep -v 'CHECK' > %t
-// RUN: %clang_cc1 -pedantic -Werror -x c -
-// RUN: FileCheck -input-file=%t %s
+// RUN: cp %s %t
+// RUN: %clang_cc1 -pedantic -fixit -x c %t || true
+// RUN: grep -v CHECK %t > %t2
+// RUN: %clang_cc1 -pedantic -Werror -x c %t
+// RUN: FileCheck -input-file=%t2 %t
/* This is a test of the various code modification hints that are
provided as part of warning or extension diagnostics. All of the
@@ -25,7 +27,7 @@ struct s s0 = { y: 5 };
// CHECK: int array0[5] = { [3] = 3 };
int array0[5] = { [3] 3 };
-void f1(x, y)
+void f1(x, y)
{
}
diff --git a/clang/test/FixIt/fixit.cpp b/clang/test/FixIt/fixit.cpp
index f596226e9f1..b9282c4d948 100644
--- a/clang/test/FixIt/fixit.cpp
+++ b/clang/test/FixIt/fixit.cpp
@@ -1,11 +1,13 @@
-// RUN: %clang_cc1 -pedantic -Wall -fixit %s -o - | %clang_cc1 -fsyntax-only -pedantic -Wall -Werror -x c++ -
+// RUN: cp %s %t
+// RUN: %clang_cc1 -pedantic -Wall -fixit -x c++ %t || true
+// RUN: %clang_cc1 -fsyntax-only -pedantic -Wall -Werror -x c++ %t
/* This is a test of the various code modification hints that are
provided as part of warning or extension diagnostics. All of the
warnings will be fixed by -fixit, and the resulting file should
compile cleanly with -Werror -pedantic. */
-struct C1 {
+struct C1 {
virtual void f();
static void g();
};
@@ -44,7 +46,7 @@ void f(); // expected-warning{{missing exception specification}}
namespace rdar7853795 {
struct A {
bool getNumComponents() const; // expected-note{{declared here}}
- void dump() const {
+ void dump() const {
getNumComponenets(); // expected-error{{use of undeclared identifier 'getNumComponenets'; did you mean 'getNumComponents'?}}
}
};
diff --git a/clang/test/FixIt/typo.c b/clang/test/FixIt/typo.c
index 72e3d658e7b..01ff3a09cf3 100644
--- a/clang/test/FixIt/typo.c
+++ b/clang/test/FixIt/typo.c
@@ -1,5 +1,7 @@
// RUN: %clang_cc1 -fsyntax-only -verify %s
-// RUN: %clang_cc1 -fsyntax-only -fixit -o - %s | %clang_cc1 -fsyntax-only -pedantic -Werror -x c -
+// RUN: cp %s %t
+// RUN: %clang_cc1 -fsyntax-only -fixit -x c %t || true
+// RUN: %clang_cc1 -fsyntax-only -pedantic -Werror -x c %t
struct Point {
float x, y;
};
diff --git a/clang/test/FixIt/typo.cpp b/clang/test/FixIt/typo.cpp
index dc6789fa861..5b9e68bbfd3 100644
--- a/clang/test/FixIt/typo.cpp
+++ b/clang/test/FixIt/typo.cpp
@@ -1,5 +1,7 @@
// RUN: %clang_cc1 -fsyntax-only -verify %s
-// RUN: %clang_cc1 -fsyntax-only -fixit -o - %s | %clang_cc1 -fsyntax-only -pedantic -Werror -x c++ -
+// RUN: cp %s %t
+// RUN: %clang_cc1 -fsyntax-only -fixit -x c++ %t || true
+// RUN: %clang_cc1 -fsyntax-only -pedantic -Werror -x c++ %t
namespace std {
template<typename T> class basic_string { // expected-note 2{{'basic_string' declared here}}
public:
diff --git a/clang/test/FixIt/typo.m b/clang/test/FixIt/typo.m
index 00eb642a183..f161bb8d994 100644
--- a/clang/test/FixIt/typo.m
+++ b/clang/test/FixIt/typo.m
@@ -1,6 +1,7 @@
// RUN: %clang_cc1 -fsyntax-only -verify %s
-// FIXME: the test below isn't testing quite what we want...
-// RUN: %clang_cc1 -fsyntax-only -fixit -o - %s | %clang_cc1 -fsyntax-only -pedantic -Werror -x objective-c -
+// RUN: cp %s %t
+// RUN: %clang_cc1 -fsyntax-only -fixit %t || true
+// RUN: %clang_cc1 -fsyntax-only -pedantic -Werror -x objective-c %t
// XFAIL: *
@interface NSString // expected-note{{'NSString' declared here}}
OpenPOWER on IntegriCloud