brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.3 KiB · b95af16 Raw
63 lines · c
1// RUN: %clang_cc1 -fsyntax-only -fms-extensions -verify -triple x86_64-apple-darwin9 %s2 3#pragma ms_struct on4 5#pragma ms_struct off6 7#pragma ms_struct reset8 9#pragma ms_struct // expected-warning {{incorrect use of '#pragma ms_struct on|off' - ignored}}10 11#pragma ms_struct on top of spaghetti  // expected-warning {{extra tokens at end of '#pragma ms_struct' - ignored}}12 13struct foo14{15  int a;16  int b;17  char c;18};19 20 21struct {22                   unsigned long bf_1 : 12;23                   unsigned long : 0;24                   unsigned long bf_2 : 12;25} __attribute__((__ms_struct__)) t1;26 27struct S {28		   double __attribute__((ms_struct)) d;	// expected-warning {{'ms_struct' attribute only applies to structs, unions, and classes}}29                   unsigned long bf_1 : 12;30                   unsigned long : 0;31                   unsigned long bf_2 : 12;32} __attribute__((ms_struct)) t2;33 34enum35{36  A = 0,37  B,38  C39} __attribute__((ms_struct)) e1; // expected-warning {{'ms_struct' attribute only applies to}}40 41#pragma ms_struct on42 43typedef struct44{45void *pv;46int l;47} Foo;48 49typedef struct50{51void *pv1;52Foo foo;53unsigned short fInited : 1;54void *pv2;55} PackOddity;56 57#pragma ms_struct off58 59static int arr[sizeof(PackOddity) == 40 ? 1 : -1];60 61struct __declspec(ms_struct) bad { // expected-warning {{__declspec attribute 'ms_struct' is not supported}}62};63