Jordan Rose | b2ae804 | 2013-08-23 16:12:49 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -fsyntax-only -Wnewline-eof -verify %s |
| 2 | // RUN: %clang_cc1 -fsyntax-only -pedantic -verify %s |
| 3 | // RUN: %clang_cc1 -fsyntax-only -x c++ -std=c++03 -pedantic -verify %s |
| 4 | // RUN: %clang_cc1 -fsyntax-only -Wnewline-eof %s 2>&1 | FileCheck %s |
Anna Zaks | cfe1bcb | 2011-07-22 23:08:19 +0000 | [diff] [blame] | 5 | // rdar://9133072 |
| 6 | |
Jordan Rose | 7865b8e | 2013-08-23 15:42:01 +0000 | [diff] [blame] | 7 | // In C++11 mode, this is allowed, so don't warn in pedantic mode. |
Jordan Rose | b2ae804 | 2013-08-23 16:12:49 +0000 | [diff] [blame] | 8 | // RUN: %clang_cc1 -fsyntax-only -x c++ -std=c++11 -Wnewline-eof -verify %s |
| 9 | // RUN: %clang_cc1 -fsyntax-only -x c++ -std=c++11 -Werror -pedantic %s |
Jordan Rose | 7865b8e | 2013-08-23 15:42:01 +0000 | [diff] [blame] | 10 | |
Jordan Rose | 2e413f9 | 2012-06-19 03:09:38 +0000 | [diff] [blame] | 11 | // Make sure the diagnostic shows up properly at the end of the last line. |
Jordan Rose | 7865b8e | 2013-08-23 15:42:01 +0000 | [diff] [blame] | 12 | // CHECK: newline-eof.c:[[@LINE+3]]:63 |
Jordan Rose | 2e413f9 | 2012-06-19 03:09:38 +0000 | [diff] [blame] | 13 | |
Anna Zaks | cfe1bcb | 2011-07-22 23:08:19 +0000 | [diff] [blame] | 14 | // The following line isn't terminated, don't fix it. |
Seth Cantrell | d555222 | 2012-04-13 01:00:34 +0000 | [diff] [blame] | 15 | void foo() {} // expected-warning{{no newline at end of file}} |