summaryrefslogtreecommitdiffstats
path: root/clang/test
diff options
context:
space:
mode:
Diffstat (limited to 'clang/test')
-rw-r--r--clang/test/Lexer/newline-eof-c++11.cpp5
-rw-r--r--clang/test/Lexer/newline-eof-c++98-compat.cpp1
-rw-r--r--clang/test/Lexer/newline-eof.c12
3 files changed, 10 insertions, 8 deletions
diff --git a/clang/test/Lexer/newline-eof-c++11.cpp b/clang/test/Lexer/newline-eof-c++11.cpp
deleted file mode 100644
index eeabe8bb9fc..00000000000
--- a/clang/test/Lexer/newline-eof-c++11.cpp
+++ /dev/null
@@ -1,5 +0,0 @@
-// RUN: %clang_cc1 -fsyntax-only -std=c++11 -Wnewline-eof -verify %s
-// expected-no-diagnostics
-
-// The following line isn't terminated, don't fix it.
-void foo() {} \ No newline at end of file
diff --git a/clang/test/Lexer/newline-eof-c++98-compat.cpp b/clang/test/Lexer/newline-eof-c++98-compat.cpp
index 3e5c8e22623..9af0b889537 100644
--- a/clang/test/Lexer/newline-eof-c++98-compat.cpp
+++ b/clang/test/Lexer/newline-eof-c++98-compat.cpp
@@ -1,4 +1,5 @@
// RUN: %clang_cc1 -fsyntax-only -Wc++98-compat-pedantic -std=c++11 -verify %s
+// RUN: %clang_cc1 -fsyntax-only -Wc++98-compat-pedantic -Wnewline-eof -std=c++11 -verify %s
// The following line isn't terminated, don't fix it.
void foo() {} // expected-warning{{C++98 requires newline at end of file}} \ No newline at end of file
diff --git a/clang/test/Lexer/newline-eof.c b/clang/test/Lexer/newline-eof.c
index a4a18835cf5..d762519aaae 100644
--- a/clang/test/Lexer/newline-eof.c
+++ b/clang/test/Lexer/newline-eof.c
@@ -1,9 +1,15 @@
-// RUN: %clang_cc1 -fsyntax-only -Wnewline-eof -verify %s
-// RUN: %clang_cc1 -fsyntax-only -Wnewline-eof %s 2>&1 | FileCheck %s
+// RUN: %clang -fsyntax-only -Wnewline-eof -verify %s
+// RUN: %clang -fsyntax-only -pedantic -verify %s
+// RUN: %clang -fsyntax-only -x c++ -std=c++03 -pedantic -verify %s
+// RUN: %clang -fsyntax-only -Wnewline-eof %s 2>&1 | FileCheck %s
// rdar://9133072
+// In C++11 mode, this is allowed, so don't warn in pedantic mode.
+// RUN: %clang -fsyntax-only -x c++ -std=c++11 -Wnewline-eof -verify %s
+// RUN: %clang -fsyntax-only -x c++ -std=c++11 -pedantic %s
+
// Make sure the diagnostic shows up properly at the end of the last line.
-// CHECK: newline-eof.c:9:63
+// CHECK: newline-eof.c:[[@LINE+3]]:63
// The following line isn't terminated, don't fix it.
void foo() {} // expected-warning{{no newline at end of file}} \ No newline at end of file
OpenPOWER on IntegriCloud