brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.9 KiB · d1885a5 Raw
61 lines · c
1// RUN: %clang_cc1 -fsyntax-only -verify -fms-extensions %s2// RUN: %clang_cc1 -fsyntax-only -verify -fms-compatibility %s3// RUN: %clang_cc1 -fsyntax-only -verify -triple i386-pc-win32 -fms-compatibility %s4 5__int8 x1  = 3i8;6__int16 x2 = 4i16;7__int32 x3 = 5i32;8__int64 x5 = 0x42i64;9__int64 x6 = 0x42I64;10 11__int64 y = 0x42i64u;  // expected-error {{invalid suffix}}12__int64 w = 0x43ui64; 13__int64 z = 9Li64;  // expected-error {{invalid suffix}}14__int64 q = 10lli64;  // expected-error {{invalid suffix}}15 16__complex double c1 = 1i; // GNU extension17__complex double c2 = 1.0i; // GNU extension18__complex float c3 = 1.0if;19 20#define UINT128_MAX 0xffffffffffffffffffffffffffffffffui12821#define ULLONG_MAX 0xffffffffffffffffui6422#define UINT 0xffffffffui3223#define USHORT 0xffffui1624#define UCHAR 0xffui825 26#define INT128_MAX 170141183460469231731687303715884105727i12827 28void a(void) {29#if __SIZEOF_INT128__30        __int128 j = UINT128_MAX;31        __int128 k = INT128_MAX;32#else33        int j = UINT128_MAX;34        // expected-warning@-1{{implicit conversion from 'unsigned __int128' to 'int' changes value from 340282366920938463463374607431768211455 to -1}}35        // expected-error@-2{{integer literal is too large to be represented in any integer type}}36        int k = INT128_MAX;37        // expected-warning@-1{{implicit conversion from '__int128' to 'int' changes value from 170141183460469231731687303715884105727 to -1}}38        // expected-error@-2{{integer literal is too large to be represented in any signed integer type}}39#endif40	unsigned long long m = ULLONG_MAX;41	unsigned int n = UINT;42        unsigned short s = USHORT;43        unsigned char c = UCHAR;44}45 46void pr_7968(void)47{48  int var1 = 0x1111111e+1;49  int var2 = 0X1111111e+1;50  int var3 = 0xe+1;51  int var4 = 0XE+1;52 53  int var5=    0\54x1234e+1;55 56  int var6=57  /*expected-warning {{backslash and newline separated by space}} */    0\       58x1234e+1;                      59}60 61