1 // RUN: %clang_cc1 %s -fms-extensions -E | FileCheck %s 2 // We use -fms-extensions to test both _Pragma and __pragma. 3 4 // A long time ago the pragma lexer's buffer showed through in -E output. 5 // CHECK-NOT: scratch space 6 7 #define push_p _Pragma ("pack(push)") 8 push_p 9 // CHECK: #pragma pack(push) 10 __pragma(pack (push))11push_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) 17 18 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") 22 23 void test () { 24 1;_Pragma("clang diagnostic push") \ 25 _Pragma("clang diagnostic ignored \"-Wformat-extra-args\"") 26 _Pragma("clang diagnostic pop") 27 28 2;__PRAGMA_PUSH_NO_EXTRA_ARG_WARNINGS 29 3;__PRAGMA_POP_NO_EXTRA_ARG_WARNINGS 30 } 31 32 // CHECK: void test () { 33 // CHECK-NEXT: 1; 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 38 39 // CHECK: 2; 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" 44 // CHECK-NEXT: 3; 45 // CHECK-NEXT: # 29 "{{.*}}_Pragma-location.c" 46 // CHECK-NEXT: #pragma clang diagnostic pop 47 // CHECK-NEXT: } 48