25 lines · cpp
1/* RUN: %clang_cc1 -x c -std=c89 -fsyntax-only -verify -pedantic-errors -Wno-empty-translation-unit %s2 * RUN: %clang_cc1 -x c -std=c99 -fsyntax-only -verify -pedantic-errors -Wno-empty-translation-unit %s3 * RUN: %clang_cc1 -x c++ -std=c++98 -fsyntax-only -verify -pedantic-errors -Wno-empty-translation-unit %s4 * RUN: %clang_cc1 -x c++ -std=c++11 -fsyntax-only -verify -Wc++98-compat-pedantic -Wno-empty-translation-unit %s5 */6 7#if !defined(__cplusplus)8# if __STDC_VERSION__ < 199901L9/* expected-error@21 {{'long long' is an extension when C99 mode is not enabled}} */10# else11/* expected-no-diagnostics */12# endif13#else14# if __cplusplus < 201103L15/* expected-error@21 {{'long long' is a C++11 extension}} */16# else17/* expected-warning@21 {{'long long' is incompatible with C++98}} */18# endif19#endif20 21#if 1 > 2LL22# error should not happen23#endif24 25