1 // RUN: %clang_cc1 %s -fms-extensions -E | FileCheck %s
2 // We use -fms-extensions to test both _Pragma and __pragma.
4 // A long time ago the pragma lexer's buffer showed through in -E output.
5 // CHECK-NOT: scratch space
7 #define push_p _Pragma ("pack(push)")
9 // CHECK: #pragma pack(push)
11 push_p
_Pragma("pack(push)") __pragma(pack(push
))
12 // CHECK: #pragma pack(push)
13 // CHECK-NEXT: # 11 "{{.*}}_Pragma-location.c"
14 // CHECK-NEXT: #pragma pack(push)
15 // CHECK-NEXT: # 11 "{{.*}}_Pragma-location.c"
16 // CHECK-NEXT: #pragma pack(push)
19 #define __PRAGMA_PUSH_NO_EXTRA_ARG_WARNINGS _Pragma("clang diagnostic push") \
20 _Pragma("clang diagnostic ignored \"-Wformat-extra-args\"")
21 #define __PRAGMA_POP_NO_EXTRA_ARG_WARNINGS _Pragma("clang diagnostic pop")
24 1;_Pragma("clang diagnostic push") \
25 _Pragma("clang diagnostic ignored \"-Wformat-extra-args\"")
26 _Pragma("clang diagnostic pop")
28 2;__PRAGMA_PUSH_NO_EXTRA_ARG_WARNINGS
29 3;__PRAGMA_POP_NO_EXTRA_ARG_WARNINGS
32 // CHECK: void test () {
34 // CHECK-NEXT: # 24 "{{.*}}_Pragma-location.c"
35 // CHECK-NEXT: #pragma clang diagnostic push
36 // CHECK-NEXT: #pragma clang diagnostic ignored "-Wformat-extra-args"
37 // CHECK-NEXT: #pragma clang diagnostic pop
40 // CHECK-NEXT: # 28 "{{.*}}_Pragma-location.c"
41 // CHECK-NEXT: #pragma clang diagnostic push
42 // CHECK-NEXT: # 28 "{{.*}}_Pragma-location.c"
43 // CHECK-NEXT: #pragma clang diagnostic ignored "-Wformat-extra-args"
45 // CHECK-NEXT: # 29 "{{.*}}_Pragma-location.c"
46 // CHECK-NEXT: #pragma clang diagnostic pop