Daniel Dunbar | a572887 | 2009-12-15 20:14:24 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -fsyntax-only -verify -fms-extensions %s |
Douglas Gregor | 0bb935c | 2011-10-24 15:27:23 +0000 | [diff] [blame] | 2 | // RUN: %clang_cc1 -fsyntax-only -verify -fms-compatibility %s |
Nuno Lopes | 6e8c7ac | 2009-11-28 13:37:52 +0000 | [diff] [blame] | 3 | |
| 4 | __int8 x1 = 3i8; |
| 5 | __int16 x2 = 4i16; |
| 6 | __int32 x3 = 5i32; |
| 7 | __int64 x5 = 0x42i64; |
Chris Lattner | c637415 | 2010-10-14 00:24:10 +0000 | [diff] [blame] | 8 | __int64 x6 = 0x42I64; |
Nuno Lopes | 6e8c7ac | 2009-11-28 13:37:52 +0000 | [diff] [blame] | 9 | __int64 x4 = 70000000i128; |
| 10 | |
| 11 | __int64 y = 0x42i64u; // expected-error {{invalid suffix}} |
Fariborz Jahanian | a8be02b | 2010-01-22 21:36:53 +0000 | [diff] [blame] | 12 | __int64 w = 0x43ui64; |
Nuno Lopes | 6e8c7ac | 2009-11-28 13:37:52 +0000 | [diff] [blame] | 13 | __int64 z = 9Li64; // expected-error {{invalid suffix}} |
| 14 | __int64 q = 10lli64; // expected-error {{invalid suffix}} |
Fariborz Jahanian | a8be02b | 2010-01-22 21:36:53 +0000 | [diff] [blame] | 15 | |
| 16 | // radar 7562363 |
| 17 | #define ULLONG_MAX 0xffffffffffffffffui64 |
| 18 | #define UINT 0xffffffffui32 |
Fariborz Jahanian | f57b820 | 2010-01-22 22:30:25 +0000 | [diff] [blame] | 19 | #define USHORT 0xffffui16 |
| 20 | #define UCHAR 0xffui8 |
Fariborz Jahanian | a8be02b | 2010-01-22 21:36:53 +0000 | [diff] [blame] | 21 | |
| 22 | void a() { |
| 23 | unsigned long long m = ULLONG_MAX; |
| 24 | unsigned int n = UINT; |
| 25 | unsigned short s = USHORT; |
| 26 | unsigned char c = UCHAR; |
| 27 | } |
Douglas Gregor | a75ec43 | 2010-08-30 14:50:47 +0000 | [diff] [blame] | 28 | |
| 29 | void pr_7968() |
| 30 | { |
| 31 | int var1 = 0x1111111e+1; |
| 32 | int var2 = 0X1111111e+1; |
| 33 | int var3 = 0xe+1; |
| 34 | int var4 = 0XE+1; |
Chris Lattner | 6ab55eb | 2010-08-31 16:42:00 +0000 | [diff] [blame] | 35 | |
| 36 | int var5= 0\ |
| 37 | x1234e+1; |
| 38 | |
| 39 | int var6= |
| 40 | /*expected-warning {{backslash and newline separated by space}} */ 0\ |
| 41 | x1234e+1; |
Douglas Gregor | a75ec43 | 2010-08-30 14:50:47 +0000 | [diff] [blame] | 42 | } |
Chris Lattner | 6ab55eb | 2010-08-31 16:42:00 +0000 | [diff] [blame] | 43 | |