xref: /minix3/external/bsd/llvm/dist/clang/test/Lexer/ms-extensions.c (revision 0a6a1f1d05b60e214de2f05a7310ddd1f0e590e7)
1f4a2713aSLionel Sambuc // RUN: %clang_cc1 -fsyntax-only -verify -fms-extensions %s
2f4a2713aSLionel Sambuc // RUN: %clang_cc1 -fsyntax-only -verify -fms-compatibility %s
3*0a6a1f1dSLionel Sambuc // RUN: %clang_cc1 -fsyntax-only -verify -triple i386-pc-win32 -fms-compatibility %s
4f4a2713aSLionel Sambuc 
5f4a2713aSLionel Sambuc __int8 x1  = 3i8;
6f4a2713aSLionel Sambuc __int16 x2 = 4i16;
7f4a2713aSLionel Sambuc __int32 x3 = 5i32;
8f4a2713aSLionel Sambuc __int64 x5 = 0x42i64;
9f4a2713aSLionel Sambuc __int64 x6 = 0x42I64;
10*0a6a1f1dSLionel Sambuc #ifndef __SIZEOF_INT128__
11*0a6a1f1dSLionel Sambuc // expected-error@+2 {{__int128 is not supported on this target}}
12*0a6a1f1dSLionel Sambuc #endif
13f4a2713aSLionel Sambuc __int64 x4 = 70000000i128;
14f4a2713aSLionel Sambuc 
15f4a2713aSLionel Sambuc __int64 y = 0x42i64u;  // expected-error {{invalid suffix}}
16f4a2713aSLionel Sambuc __int64 w = 0x43ui64;
17f4a2713aSLionel Sambuc __int64 z = 9Li64;  // expected-error {{invalid suffix}}
18f4a2713aSLionel Sambuc __int64 q = 10lli64;  // expected-error {{invalid suffix}}
19f4a2713aSLionel Sambuc 
20*0a6a1f1dSLionel Sambuc __complex double c1 = 1i;
21*0a6a1f1dSLionel Sambuc __complex double c2 = 1.0i;
22*0a6a1f1dSLionel Sambuc __complex float c3 = 1.0if;
23*0a6a1f1dSLionel Sambuc 
24f4a2713aSLionel Sambuc // radar 7562363
25f4a2713aSLionel Sambuc #define ULLONG_MAX 0xffffffffffffffffui64
26f4a2713aSLionel Sambuc #define UINT 0xffffffffui32
27f4a2713aSLionel Sambuc #define USHORT 0xffffui16
28f4a2713aSLionel Sambuc #define UCHAR 0xffui8
29f4a2713aSLionel Sambuc 
a()30f4a2713aSLionel Sambuc void a() {
31f4a2713aSLionel Sambuc 	unsigned long long m = ULLONG_MAX;
32f4a2713aSLionel Sambuc 	unsigned int n = UINT;
33f4a2713aSLionel Sambuc         unsigned short s = USHORT;
34f4a2713aSLionel Sambuc         unsigned char c = UCHAR;
35f4a2713aSLionel Sambuc }
36f4a2713aSLionel Sambuc 
pr_7968()37f4a2713aSLionel Sambuc void pr_7968()
38f4a2713aSLionel Sambuc {
39f4a2713aSLionel Sambuc   int var1 = 0x1111111e+1;
40f4a2713aSLionel Sambuc   int var2 = 0X1111111e+1;
41f4a2713aSLionel Sambuc   int var3 = 0xe+1;
42f4a2713aSLionel Sambuc   int var4 = 0XE+1;
43f4a2713aSLionel Sambuc 
44f4a2713aSLionel Sambuc   int var5=    0\
45f4a2713aSLionel Sambuc x1234e+1;
46f4a2713aSLionel Sambuc 
47f4a2713aSLionel Sambuc   int var6=
48f4a2713aSLionel Sambuc   /*expected-warning {{backslash and newline separated by space}} */    0\
49f4a2713aSLionel Sambuc x1234e+1;
50f4a2713aSLionel Sambuc }
51f4a2713aSLionel Sambuc 
52