aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/FixIt/fixit-at.c5
-rw-r--r--test/FixIt/fixit-c90.c8
-rw-r--r--test/FixIt/fixit-cxx0x.cpp10
-rw-r--r--test/FixIt/fixit-errors-1.c5
-rw-r--r--test/FixIt/fixit-errors.c4
-rw-r--r--test/FixIt/fixit-objc.m5
-rw-r--r--test/FixIt/fixit-pmem.cpp4
-rw-r--r--test/FixIt/fixit-suffix.c5
-rw-r--r--test/FixIt/fixit-unrecoverable.c2
-rw-r--r--test/FixIt/fixit.c10
-rw-r--r--test/FixIt/fixit.cpp8
-rw-r--r--test/FixIt/typo.c4
-rw-r--r--test/FixIt/typo.cpp4
-rw-r--r--test/FixIt/typo.m5
14 files changed, 51 insertions, 28 deletions
diff --git a/test/FixIt/fixit-at.c b/test/FixIt/fixit-at.c
deleted file mode 100644
index c32aee9ea1..0000000000
--- a/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/test/FixIt/fixit-c90.c b/test/FixIt/fixit-c90.c
index e84733f49d..0bc1fada8b 100644
--- a/test/FixIt/fixit-c90.c
+++ b/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/test/FixIt/fixit-cxx0x.cpp b/test/FixIt/fixit-cxx0x.cpp
index 3694b9db1a..d8a858d9da 100644
--- a/test/FixIt/fixit-cxx0x.cpp
+++ b/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/test/FixIt/fixit-errors-1.c b/test/FixIt/fixit-errors-1.c
index ecad53ceb8..96f27eb6d0 100644
--- a/test/FixIt/fixit-errors-1.c
+++ b/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/test/FixIt/fixit-errors.c b/test/FixIt/fixit-errors.c
index 0a60e5b117..ff063635f6 100644
--- a/test/FixIt/fixit-errors.c
+++ b/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/test/FixIt/fixit-objc.m b/test/FixIt/fixit-objc.m
index 6aa1b33ea1..03f28a1b58 100644
--- a/test/FixIt/fixit-objc.m
+++ b/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/test/FixIt/fixit-pmem.cpp b/test/FixIt/fixit-pmem.cpp
index 8dfab8f658..b69eadf15a 100644
--- a/test/FixIt/fixit-pmem.cpp
+++ b/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/test/FixIt/fixit-suffix.c b/test/FixIt/fixit-suffix.c
new file mode 100644
index 0000000000..a1a747a95a
--- /dev/null
+++ b/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/test/FixIt/fixit-unrecoverable.c b/test/FixIt/fixit-unrecoverable.c
index 5c825f23cf..8052beb559 100644
--- a/test/FixIt/fixit-unrecoverable.c
+++ b/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/test/FixIt/fixit.c b/test/FixIt/fixit.c
index 9f858524c2..b799fa3b3b 100644
--- a/test/FixIt/fixit.c
+++ b/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/test/FixIt/fixit.cpp b/test/FixIt/fixit.cpp
index f596226e9f..b9282c4d94 100644
--- a/test/FixIt/fixit.cpp
+++ b/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/test/FixIt/typo.c b/test/FixIt/typo.c
index 72e3d658e7..01ff3a09cf 100644
--- a/test/FixIt/typo.c
+++ b/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/test/FixIt/typo.cpp b/test/FixIt/typo.cpp
index dc6789fa86..5b9e68bbfd 100644
--- a/test/FixIt/typo.cpp
+++ b/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/test/FixIt/typo.m b/test/FixIt/typo.m
index 00eb642a18..f161bb8d99 100644
--- a/test/FixIt/typo.m
+++ b/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}}