blob: 1a0f37b7ff40b4c7f5e8d29f345dd4b1c6e320c9 [file] [log] [blame]
Dmitri Gribenkoe3b136b2012-09-24 18:19:21 +00001/* RUN: %clang_cc1 -x c -std=c89 -fsyntax-only -verify -pedantic-errors -Wno-empty-translation-unit %s
2 * RUN: %clang_cc1 -x c -std=c99 -fsyntax-only -verify -pedantic-errors -Wno-empty-translation-unit %s
3 * RUN: %clang_cc1 -x c++ -std=c++98 -fsyntax-only -verify -pedantic-errors -Wno-empty-translation-unit %s
4 * RUN: %clang_cc1 -x c++ -std=c++11 -fsyntax-only -verify -Wc++98-compat-pedantic -Wno-empty-translation-unit %s
5 */
6
7#if !defined(__cplusplus)
8# if __STDC_VERSION__ < 199901L
Andy Gibbs8e8fb3b2012-10-19 12:44:48 +00009/* expected-error@21 {{'long long' is an extension when C99 mode is not enabled}} */
10# else
11/* expected-no-diagnostics */
Dmitri Gribenkoe3b136b2012-09-24 18:19:21 +000012# endif
13#else
14# if __cplusplus < 201103L
Andy Gibbs8e8fb3b2012-10-19 12:44:48 +000015/* expected-error@21 {{'long long' is a C++11 extension}} */
Dmitri Gribenkoe3b136b2012-09-24 18:19:21 +000016# else
Andy Gibbs8e8fb3b2012-10-19 12:44:48 +000017/* expected-warning@21 {{'long long' is incompatible with C++98}} */
Dmitri Gribenkoe3b136b2012-09-24 18:19:21 +000018# endif
19#endif
20
21#if 1 > 2LL
22# error should not happen
23#endif
24