2 // RUN: %clang_cc1 -std=c99 -fsyntax-only -verify=pre-c2x-pedantic -pedantic %s
3 // RUN: %clang_cc1 -std=c2x -fsyntax-only -verify=pre-c2x-compat -Wpre-c2x-compat %s
4 // RUN: not %clang_cc1 -std=c99 -fsyntax-only -verify %s
5 // RUN: not %clang_cc1 -std=c2x -fsyntax-only -verify -pedantic %s
6 // RUN: not %clang_cc1 -std=c2x -fsyntax-only -verify %s
9 // RUN: %clang_cc1 -x c++ -fsyntax-only -verify=pre-cpp23-pedantic -pedantic %s
10 // RUN: %clang_cc1 -x c++ -std=c++23 -fsyntax-only -verify=pre-cpp23-compat -Wpre-c++23-compat %s
11 // RUN: not %clang_cc1 -x c++ -fsyntax-only -verify %s
12 // RUN: not %clang_cc1 -x c++ -std=c++23 -fsyntax-only -verify -pedantic %s
13 // RUN: not %clang_cc1 -x c++ -std=c++23 -fsyntax-only -verify %s
21 // pre-c2x-pedantic-warning@#1 {{use of a '#elifdef' directive is a C23 extension}}
22 // pre-c2x-compat-warning@#1 {{use of a '#elifdef' directive is incompatible with C standards before C23}}
25 // pre-cpp23-pedantic-warning@#1 {{use of a '#elifdef' directive is a C++23 extension}}
26 // pre-cpp23-compat-warning@#1 {{use of a '#elifdef' directive is incompatible with C++ standards before C++23}}
32 // pre-c2x-pedantic-warning@#2 {{use of a '#elifndef' directive is a C23 extension}}
33 // pre-c2x-compat-warning@#2 {{use of a '#elifndef' directive is incompatible with C standards before C23}}
36 // pre-cpp23-pedantic-warning@#2 {{use of a '#elifndef' directive is a C++23 extension}}
37 // pre-cpp23-compat-warning@#2 {{use of a '#elifndef' directive is incompatible with C++ standards before C++23}}
43 // pre-c2x-pedantic-warning@-3 {{use of a '#elifdef' directive is a C23 extension}}
44 // pre-c2x-compat-warning@-4 {{use of a '#elifdef' directive is incompatible with C standards before C23}}
47 // pre-cpp23-pedantic-warning@-7 {{use of a '#elifdef' directive is a C++23 extension}}
48 // pre-cpp23-compat-warning@-8 {{use of a '#elifdef' directive is incompatible with C++ standards before C++23}}
54 // pre-c2x-pedantic-warning@-3 {{use of a '#elifndef' directive is a C23 extension}}
55 // pre-c2x-compat-warning@-4 {{use of a '#elifndef' directive is incompatible with C standards before C23}}
58 // pre-cpp23-pedantic-warning@-7 {{use of a '#elifndef' directive is a C++23 extension}}
59 // pre-cpp23-compat-warning@-8 {{use of a '#elifndef' directive is incompatible with C++ standards before C++23}}
63 // pre-c2x-pedantic-warning@-2 {{#warning is a C23 extension}}
64 // pre-c2x-pedantic-warning@-3 {{foo}}
65 // pre-c2x-compat-warning@-4 {{#warning is incompatible with C standards before C23}}
66 // pre-c2x-compat-warning@-5 {{foo}}
69 // pre-cpp23-pedantic-warning@-8 {{#warning is a C++23 extension}}
70 // pre-cpp23-pedantic-warning@-9 {{foo}}
71 // pre-cpp23-compat-warning@-10 {{#warning is incompatible with C++ standards before C++23}}
72 // pre-cpp23-compat-warning@-11 {{foo}}