xref: /minix3/external/bsd/llvm/dist/clang/test/Sema/MicrosoftCompatibility.c (revision 0a6a1f1d05b60e214de2f05a7310ddd1f0e590e7)
1f4a2713aSLionel Sambuc // RUN: %clang_cc1 %s -fsyntax-only -Wno-unused-value -Wmicrosoft -verify -fms-compatibility
2f4a2713aSLionel Sambuc 
3f4a2713aSLionel Sambuc enum ENUM1; // expected-warning {{forward references to 'enum' types are a Microsoft extension}}
4f4a2713aSLionel Sambuc enum ENUM1 var1 = 3;
5f4a2713aSLionel Sambuc enum ENUM1* var2 = 0;
6f4a2713aSLionel Sambuc 
7f4a2713aSLionel Sambuc 
8f4a2713aSLionel Sambuc enum ENUM2 {
9f4a2713aSLionel Sambuc   ENUM2_a = (enum ENUM2) 4,
10f4a2713aSLionel Sambuc   ENUM2_b = 0x9FFFFFFF, // expected-warning {{enumerator value is not representable in the underlying type 'int'}}
11f4a2713aSLionel Sambuc   ENUM2_c = 0x100000000 // expected-warning {{enumerator value is not representable in the underlying type 'int'}}
12f4a2713aSLionel Sambuc };
13f4a2713aSLionel Sambuc 
f6(void)14f4a2713aSLionel Sambuc __declspec(noreturn) void f6( void ) {
15f4a2713aSLionel Sambuc 	return;  // expected-warning {{function 'f6' declared 'noreturn' should not return}}
16f4a2713aSLionel Sambuc }
17f4a2713aSLionel Sambuc 
18f4a2713aSLionel Sambuc __declspec(align(32768)) struct S1 { int a; } s;	/* expected-error {{requested alignment must be 8192 bytes or smaller}} */
19*0a6a1f1dSLionel Sambuc struct __declspec(aligned) S2 {}; /* expected-warning {{__declspec attribute 'aligned' is not supported}} */
20f4a2713aSLionel Sambuc 
21f4a2713aSLionel Sambuc struct __declspec(appdomain) S3 {}; /* expected-warning {{__declspec attribute 'appdomain' is not supported}} */
22*0a6a1f1dSLionel Sambuc 
23*0a6a1f1dSLionel Sambuc __declspec(__noreturn__) void f7(void); /* expected-warning {{__declspec attribute '__noreturn__' is not supported}} */
24