Dmitri Gribenko | e3b136b | 2012-09-24 18:19:21 +0000 | [diff] [blame^] | 1 | /* 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 |
| 9 | /* expected-error@19 {{'long long' is an extension when C99 mode is not enabled}} */ |
| 10 | # endif |
| 11 | #else |
| 12 | # if __cplusplus < 201103L |
| 13 | /* expected-error@19 {{'long long' is a C++11 extension}} */ |
| 14 | # else |
| 15 | /* expected-warning@19 {{'long long' is incompatible with C++98}} */ |
| 16 | # endif |
| 17 | #endif |
| 18 | |
| 19 | #if 1 > 2LL |
| 20 | # error should not happen |
| 21 | #endif |
| 22 | |