blob: 340d9de8d36a8de14239c023eca2324b7680cda8 [file] [log] [blame]
Jordan Roseb2ae8042013-08-23 16:12:49 +00001// 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 Zakscfe1bcb2011-07-22 23:08:19 +00005// rdar://9133072
6
Jordan Rose7865b8e2013-08-23 15:42:01 +00007// In C++11 mode, this is allowed, so don't warn in pedantic mode.
Jordan Roseb2ae8042013-08-23 16:12:49 +00008// 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 Rose7865b8e2013-08-23 15:42:01 +000010
Jordan Rose2e413f92012-06-19 03:09:38 +000011// Make sure the diagnostic shows up properly at the end of the last line.
Jordan Rose7865b8e2013-08-23 15:42:01 +000012// CHECK: newline-eof.c:[[@LINE+3]]:63
Jordan Rose2e413f92012-06-19 03:09:38 +000013
Anna Zakscfe1bcb2011-07-22 23:08:19 +000014// The following line isn't terminated, don't fix it.
Seth Cantrelld5552222012-04-13 01:00:34 +000015void foo() {} // expected-warning{{no newline at end of file}}