2013-08-23 23:42:01 +08:00
|
|
|
// 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
|
2011-07-23 07:08:19 +08:00
|
|
|
// rdar://9133072
|
|
|
|
|
2013-08-23 23:42:01 +08:00
|
|
|
// 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
|
|
|
|
|
2012-06-19 11:09:38 +08:00
|
|
|
// Make sure the diagnostic shows up properly at the end of the last line.
|
2013-08-23 23:42:01 +08:00
|
|
|
// CHECK: newline-eof.c:[[@LINE+3]]:63
|
2012-06-19 11:09:38 +08:00
|
|
|
|
2011-07-23 07:08:19 +08:00
|
|
|
// The following line isn't terminated, don't fix it.
|
2012-04-13 09:00:34 +08:00
|
|
|
void foo() {} // expected-warning{{no newline at end of file}}
|