brintos

brintos / llvm-project-archived public Read only

0
0
Text · 3.0 KiB · 0dcbb59 Raw
73 lines · c
1// For C2// RUN: %clang_cc1 -std=c99 -fsyntax-only -verify=pre-c2x-pedantic -pedantic %s3// RUN: %clang_cc1 -std=c2x -fsyntax-only -verify=pre-c2x-compat -Wpre-c2x-compat %s4// RUN: not %clang_cc1 -std=c99 -fsyntax-only -verify %s5// RUN: not %clang_cc1 -std=c2x -fsyntax-only -verify -pedantic %s6// RUN: not %clang_cc1 -std=c2x -fsyntax-only -verify %s7 8// For C++9// RUN: %clang_cc1 -x c++ -fsyntax-only -verify=pre-cpp23-pedantic -pedantic %s10// RUN: %clang_cc1 -x c++ -std=c++23 -fsyntax-only -verify=pre-cpp23-compat -Wpre-c++23-compat %s11// RUN: not %clang_cc1 -x c++ -fsyntax-only -verify %s12// RUN: not %clang_cc1 -x c++ -std=c++23 -fsyntax-only -verify -pedantic %s13// RUN: not %clang_cc1 -x c++ -std=c++23 -fsyntax-only -verify %s14 15int x;16 17#if 118#elifdef A // #119#endif20// For C21// 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}}23 24// For C++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}}27 28#if 129#elifndef B // #230#endif31// For C32// 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}}34 35// For C++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}}38 39#if 040#elifdef C41#endif42// For C43// 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}}45 46// For C++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}}49 50#if 051#elifndef D52#endif53// For C54// 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}}56 57// For C++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}}60 61#warning foo62// For C63// 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}}67 68// For C++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}}73