16 lines · c
1// RUN: %clang_cc1 -verify=good -std=c2y -Wall -pedantic %s2// RUN: %clang_cc1 -verify -Wnewline-eof -std=c2y -Wall -pedantic %s3// RUN: %clang_cc1 -verify=good -std=c23 -Wall -pedantic %s4// RUN: %clang_cc1 -verify=good -std=c23 %s5// RUN: %clang_cc1 -verify -Wnewline-eof -std=c23 %s6 7/* WG14 N3411: Yes8 * Slay Some Earthly Demons XII9 *10 * Allow a non-empty source file to end without a final newline character. Note11 * that this file intentionally does not end with a trailing newline.12 */13// good-no-diagnostics14 15int x; // Ensure the file contains at least one declaration.16// expected-warning {{no newline at end of file}}