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