Daniel Dunbar | 3573b2c | 2009-12-15 20:14:24 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -fsyntax-only -verify -fms-extensions %s |
Douglas Gregor | 3ead475 | 2011-10-24 15:27:23 +0000 | [diff] [blame] | 2 | // RUN: %clang_cc1 -fsyntax-only -verify -fms-compatibility %s |
Stephen Hines | c568f1e | 2014-07-21 00:47:37 -0700 | [diff] [blame^] | 3 | // RUN: %clang_cc1 -fsyntax-only -verify -triple i386-pc-win32 -fms-compatibility %s |
Nuno Lopes | 8687cc9 | 2009-11-28 13:37:52 +0000 | [diff] [blame] | 4 | |
| 5 | __int8 x1 = 3i8; |
| 6 | __int16 x2 = 4i16; |
| 7 | __int32 x3 = 5i32; |
| 8 | __int64 x5 = 0x42i64; |
Chris Lattner | c1be9be | 2010-10-14 00:24:10 +0000 | [diff] [blame] | 9 | __int64 x6 = 0x42I64; |
Stephen Hines | c568f1e | 2014-07-21 00:47:37 -0700 | [diff] [blame^] | 10 | #ifndef __SIZEOF_INT128__ |
| 11 | // expected-error@+2 {{__int128 is not supported on this target}} |
| 12 | #endif |
Nuno Lopes | 8687cc9 | 2009-11-28 13:37:52 +0000 | [diff] [blame] | 13 | __int64 x4 = 70000000i128; |
| 14 | |
| 15 | __int64 y = 0x42i64u; // expected-error {{invalid suffix}} |
Fariborz Jahanian | f127fb5 | 2010-01-22 21:36:53 +0000 | [diff] [blame] | 16 | __int64 w = 0x43ui64; |
Nuno Lopes | 8687cc9 | 2009-11-28 13:37:52 +0000 | [diff] [blame] | 17 | __int64 z = 9Li64; // expected-error {{invalid suffix}} |
| 18 | __int64 q = 10lli64; // expected-error {{invalid suffix}} |
Fariborz Jahanian | f127fb5 | 2010-01-22 21:36:53 +0000 | [diff] [blame] | 19 | |
Stephen Hines | c568f1e | 2014-07-21 00:47:37 -0700 | [diff] [blame^] | 20 | __complex double c1 = 1i; |
| 21 | __complex double c2 = 1.0i; |
| 22 | __complex float c3 = 1.0if; |
| 23 | |
Fariborz Jahanian | f127fb5 | 2010-01-22 21:36:53 +0000 | [diff] [blame] | 24 | // radar 7562363 |
| 25 | #define ULLONG_MAX 0xffffffffffffffffui64 |
| 26 | #define UINT 0xffffffffui32 |
Fariborz Jahanian | dc1c1a2 | 2010-01-22 22:30:25 +0000 | [diff] [blame] | 27 | #define USHORT 0xffffui16 |
| 28 | #define UCHAR 0xffui8 |
Fariborz Jahanian | f127fb5 | 2010-01-22 21:36:53 +0000 | [diff] [blame] | 29 | |
| 30 | void a() { |
| 31 | unsigned long long m = ULLONG_MAX; |
| 32 | unsigned int n = UINT; |
| 33 | unsigned short s = USHORT; |
| 34 | unsigned char c = UCHAR; |
| 35 | } |
Douglas Gregor | 51b9964 | 2010-08-30 14:50:47 +0000 | [diff] [blame] | 36 | |
| 37 | void pr_7968() |
| 38 | { |
| 39 | int var1 = 0x1111111e+1; |
| 40 | int var2 = 0X1111111e+1; |
| 41 | int var3 = 0xe+1; |
| 42 | int var4 = 0XE+1; |
Chris Lattner | 7c26de4 | 2010-08-31 16:42:00 +0000 | [diff] [blame] | 43 | |
| 44 | int var5= 0\ |
| 45 | x1234e+1; |
| 46 | |
| 47 | int var6= |
| 48 | /*expected-warning {{backslash and newline separated by space}} */ 0\ |
| 49 | x1234e+1; |
Douglas Gregor | 51b9964 | 2010-08-30 14:50:47 +0000 | [diff] [blame] | 50 | } |
Chris Lattner | 7c26de4 | 2010-08-31 16:42:00 +0000 | [diff] [blame] | 51 | |