brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.0 KiB · b85eb4a Raw
74 lines · c
1// RUN: %clang_cc1 -fsyntax-only -verify -Wfour-char-constants -pedantic -ftrigraphs %s2 3int x = 000000080;  // expected-error {{invalid digit}}4 5int y = 0000\600080;             // expected-error {{invalid digit}}7 8 9 10float X = 1.17549435e-38F;11float Y = 08.123456;12 13// PR225214#if -0x8000000000000000  // should not warn.15#endif16#if -01000000000000000000000  // should not warn.17#endif18#if 9223372036854775808 // expected-warning {{integer literal is too large to be represented in a signed integer type, interpreting as unsigned}}19#endif20#if 0x10000000000000000 // expected-error {{integer literal is too large to be represented in any integer type}}21#endif22 23int c[] = {24  'df',   // expected-warning {{multi-character character constant}}25  '\t',26  '\\27t',28  '??!',  // expected-warning {{trigraph converted to '|' character}}29  'abcd'  // expected-warning {{multi-character character constant}}30};31 32//  PR449933int m0 = '0';34int m1 = '\\\''; // expected-warning {{multi-character character constant}}35int m2 = '\\\\'; // expected-warning {{multi-character character constant}}36int m3 = '\\\37';38 39 40#pragma clang diagnostic ignored "-Wmultichar"41 42int d = 'df'; // no warning.43int e = 'abcd';  // still warn: expected-warning {{multi-character character constant}}44 45#pragma clang diagnostic ignored "-Wfour-char-constants"46 47int f = 'abcd';  // ignored.48 49float t0[] = {50  1.9e20f,51  1.9e-20f,52  1.9e50f,   // expected-warning {{too large}}53  1.9e-50f,  // expected-warning {{too small}}54  -1.9e20f,55  -1.9e-20f,56  -1.9e50f,  // expected-warning {{too large}}57  -1.9e-50f  // expected-warning {{too small}}58};59double t1[] = {60  1.9e50,61  1.9e-50,62  1.9e500,   // expected-warning {{too large}}63  1.9e-500,  // expected-warning {{too small}}64  -1.9e50,65  -1.9e-50,66  -1.9e500,  // expected-warning {{too large}}67  -1.9e-500  // expected-warning {{too small}}68};69 70// PR788871double g = 1e100000000; // expected-warning {{too large}}72 73char h = '\u1234'; // expected-error {{character too large for enclosing character literal type}}74