xref: /aosp_15_r20/external/clang/test/Lexer/long-long.cpp (revision 67e74705e28f6214e480b399dd47ea732279e315)
1*67e74705SXin Li /* RUN: %clang_cc1 -x c   -std=c89   -fsyntax-only -verify -pedantic-errors -Wno-empty-translation-unit %s
2*67e74705SXin Li  * RUN: %clang_cc1 -x c   -std=c99   -fsyntax-only -verify -pedantic-errors -Wno-empty-translation-unit %s
3*67e74705SXin Li  * RUN: %clang_cc1 -x c++ -std=c++98 -fsyntax-only -verify -pedantic-errors -Wno-empty-translation-unit %s
4*67e74705SXin Li  * RUN: %clang_cc1 -x c++ -std=c++11 -fsyntax-only -verify -Wc++98-compat-pedantic -Wno-empty-translation-unit %s
5*67e74705SXin Li  */
6*67e74705SXin Li 
7*67e74705SXin Li #if !defined(__cplusplus)
8*67e74705SXin Li #  if __STDC_VERSION__ < 199901L
9*67e74705SXin Li /* expected-error@21 {{'long long' is an extension when C99 mode is not enabled}} */
10*67e74705SXin Li #  else
11*67e74705SXin Li /* expected-no-diagnostics */
12*67e74705SXin Li #  endif
13*67e74705SXin Li #else
14*67e74705SXin Li #  if __cplusplus < 201103L
15*67e74705SXin Li /* expected-error@21 {{'long long' is a C++11 extension}} */
16*67e74705SXin Li #  else
17*67e74705SXin Li /* expected-warning@21 {{'long long' is incompatible with C++98}} */
18*67e74705SXin Li #  endif
19*67e74705SXin Li #endif
20*67e74705SXin Li 
21*67e74705SXin Li #if 1 > 2LL
22*67e74705SXin Li #  error should not happen
23*67e74705SXin Li #endif
24*67e74705SXin Li 
25