Yunzhong Gao | ef309f4 | 2014-04-11 20:55:19 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -std=c99 -E %s -o - | FileCheck --check-prefix=CHECK-NONE %s |
| 2 | |
| 3 | // RUN: %clang_cc1 -std=gnu89 -E %s -o - \ |
| 4 | // RUN: | FileCheck --check-prefix=CHECK-GNU-KEYWORDS %s |
| 5 | // RUN: %clang_cc1 -std=c99 -fgnu-keywords -E %s -o - \ |
| 6 | // RUN: | FileCheck --check-prefix=CHECK-GNU-KEYWORDS %s |
| 7 | // RUN: %clang_cc1 -std=gnu89 -fno-gnu-keywords -E %s -o - \ |
| 8 | // RUN: | FileCheck --check-prefix=CHECK-NONE %s |
| 9 | |
| 10 | // RUN: %clang_cc1 -std=c99 -fms-extensions -E %s -o - \ |
| 11 | // RUN: | FileCheck --check-prefix=CHECK-MS-KEYWORDS %s |
Saleem Abdulrasool | d170c4b | 2015-10-04 17:51:05 +0000 | [diff] [blame] | 12 | // RUN: %clang_cc1 -std=c99 -fdeclspec -E %s -o - \ |
| 13 | // RUN: | FileCheck --check-prefix=CHECK-DECLSPEC-KEYWORD %s |
| 14 | // RUN: %clang_cc1 -std=c99 -fms-extensions -fno-declspec -E %s -o - \ |
| 15 | // RUN: | FileCheck --check-prefix=CHECK-MS-KEYWORDS-WITHOUT-DECLSPEC %s |
Yunzhong Gao | ef309f4 | 2014-04-11 20:55:19 +0000 | [diff] [blame] | 16 | |
| 17 | void f() { |
| 18 | // CHECK-NONE: int asm |
| 19 | // CHECK-GNU-KEYWORDS: asm ("ret" : :) |
| 20 | #if __is_identifier(asm) |
| 21 | int asm; |
| 22 | #else |
| 23 | asm ("ret" : :); |
| 24 | #endif |
| 25 | } |
| 26 | |
| 27 | // CHECK-NONE: no_ms_wchar |
| 28 | // CHECK-MS-KEYWORDS: has_ms_wchar |
Saleem Abdulrasool | d170c4b | 2015-10-04 17:51:05 +0000 | [diff] [blame] | 29 | // CHECK-MS-KEYWORDS-WITHOUT-DECLSPEC: has_ms_wchar |
Yunzhong Gao | ef309f4 | 2014-04-11 20:55:19 +0000 | [diff] [blame] | 30 | #if __is_identifier(__wchar_t) |
| 31 | void no_ms_wchar(); |
| 32 | #else |
| 33 | void has_ms_wchar(); |
| 34 | #endif |
Saleem Abdulrasool | d170c4b | 2015-10-04 17:51:05 +0000 | [diff] [blame] | 35 | |
| 36 | // CHECK-NONE: no_declspec |
| 37 | // CHECK-MS-KEYWORDS: has_declspec |
| 38 | // CHECK-MS-KEYWORDS-WITHOUT-DECLSPEC: no_declspec |
| 39 | // CHECK-DECLSPEC-KEYWORD: has_declspec |
| 40 | #if __is_identifier(__declspec) |
| 41 | void no_declspec(); |
| 42 | #else |
| 43 | void has_declspec(); |
| 44 | #endif |