blob: 9cd868e8f3f2eb5c32e58e42e14649df32c85322 [file] [log] [blame]
Daniel Dunbara5728872009-12-15 20:14:24 +00001// RUN: %clang_cc1 -fsyntax-only -verify -fms-extensions %s
Nuno Lopes6e8c7ac2009-11-28 13:37:52 +00002
3__int8 x1 = 3i8;
4__int16 x2 = 4i16;
5__int32 x3 = 5i32;
6__int64 x5 = 0x42i64;
Chris Lattnerc6374152010-10-14 00:24:10 +00007__int64 x6 = 0x42I64;
Nuno Lopes6e8c7ac2009-11-28 13:37:52 +00008__int64 x4 = 70000000i128;
9
10__int64 y = 0x42i64u; // expected-error {{invalid suffix}}
Fariborz Jahaniana8be02b2010-01-22 21:36:53 +000011__int64 w = 0x43ui64;
Nuno Lopes6e8c7ac2009-11-28 13:37:52 +000012__int64 z = 9Li64; // expected-error {{invalid suffix}}
13__int64 q = 10lli64; // expected-error {{invalid suffix}}
Fariborz Jahaniana8be02b2010-01-22 21:36:53 +000014
15// radar 7562363
16#define ULLONG_MAX 0xffffffffffffffffui64
17#define UINT 0xffffffffui32
Fariborz Jahanianf57b8202010-01-22 22:30:25 +000018#define USHORT 0xffffui16
19#define UCHAR 0xffui8
Fariborz Jahaniana8be02b2010-01-22 21:36:53 +000020
21void 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 Gregora75ec432010-08-30 14:50:47 +000027
28void pr_7968()
29{
30 int var1 = 0x1111111e+1;
31 int var2 = 0X1111111e+1;
32 int var3 = 0xe+1;
33 int var4 = 0XE+1;
Chris Lattner6ab55eb2010-08-31 16:42:00 +000034
35 int var5= 0\
36x1234e+1;
37
38 int var6=
39 /*expected-warning {{backslash and newline separated by space}} */ 0\
40x1234e+1;
Douglas Gregora75ec432010-08-30 14:50:47 +000041}
Chris Lattner6ab55eb2010-08-31 16:42:00 +000042