152
|
1 /* { dg-options "-std=c++11" } */
|
|
2 /* Missing <cstdint>. */
|
|
3
|
|
4 char c = INT8_MAX; // { dg-error "'INT8_MAX' was not declared" }
|
|
5 // { dg-message "'INT8_MAX' is defined in header '<cstdint>'; did you forget to '#include <cstdint>'?" "" { target *-*-* } .-1 }
|
|
6
|
|
7 short s = INT16_MAX; // { dg-error "'INT16_MAX' was not declared" }
|
|
8 // { dg-message "'INT16_MAX' is defined in header '<cstdint>'; did you forget to '#include <cstdint>'?" "" { target *-*-* } .-1 }
|
|
9
|
|
10 int i = INT32_MAX; // { dg-error "'INT32_MAX' was not declared" }
|
|
11 // { dg-message "'INT32_MAX' is defined in header '<cstdint>'; did you forget to '#include <cstdint>'?" "" { target *-*-* } .-1 }
|
|
12
|
|
13 long l = INT64_MAX; // { dg-error "'INT64_MAX' was not declared" }
|
|
14 // { dg-message "'INT64_MAX' is defined in header '<cstdint>'; did you forget to '#include <cstdint>'?" "" { target *-*-* } .-1 }
|
|
15
|
|
16 intptr_t test_intptr (void) // { dg-error "'intptr_t' does not name a type" }
|
|
17 // { dg-message "'intptr_t' is defined in header '<cstdint>'; did you forget to '#include <cstdint>'?" "" { target *-*-* } .-1 }
|
|
18 {
|
|
19 return 0;
|
|
20 }
|
|
21
|
|
22 int test_intptr_max (void)
|
|
23 {
|
|
24 return (int) INTPTR_MAX; // { dg-error "'INTPTR_MAX' was not declared" }
|
|
25 // { dg-message "'INTPTR_MAX' is defined in header '<cstdint>'; did you forget to '#include <cstdint>'?" "" { target *-*-* } .-1 }
|
|
26 }
|
|
27
|
|
28 uintptr_t test_uintptr (void) // { dg-error "'uintptr_t' does not name a type" }
|
|
29 // { dg-message "'uintptr_t' is defined in header '<cstdint>'; did you forget to '#include <cstdint>'?" "" { target *-*-* } .-1 }
|
|
30 {
|
|
31 return 0;
|
|
32 }
|
|
33
|
|
34 unsigned int test_uintptr_max (void)
|
|
35 {
|
|
36 return (unsigned int) UINTPTR_MAX; // { dg-error "'UINTPTR_MAX' was not declared" }
|
|
37 // { dg-message "'UINTPTR_MAX' is defined in header '<cstdint>'; did you forget to '#include <cstdint>'?" "" { target *-*-* } .-1 }
|
|
38 }
|
|
39
|
|
40 int8_t i8; // { dg-error "'int8_t' does not name a type" }
|
|
41 // { dg-message "'int8_t' is defined in header '<cstdint>'; did you forget to '#include <cstdint>'?" "" { target *-*-* } .-1 }
|
|
42 int16_t i16; // { dg-error "'int16_t' does not name a type" }
|
|
43 // { dg-message "'int16_t' is defined in header '<cstdint>'; did you forget to '#include <cstdint>'?" "" { target *-*-* } .-1 }
|
|
44 int32_t i32; // { dg-error "'int32_t' does not name a type" }
|
|
45 // { dg-message "'int32_t' is defined in header '<cstdint>'; did you forget to '#include <cstdint>'?" "" { target *-*-* } .-1 }
|
|
46 int64_t i64; // { dg-error "'int64_t' does not name a type" }
|
|
47 // { dg-message "'int64_t' is defined in header '<cstdint>'; did you forget to '#include <cstdint>'?" "" { target *-*-* } .-1 }
|
|
48
|
|
49 void test_uint_t (void)
|
|
50 {
|
|
51 char bu8[(unsigned int)UINT8_MAX]; // { dg-error "'UINT8_MAX' was not declared" }
|
|
52 // { dg-message "'UINT8_MAX' is defined in header '<cstdint>'; did you forget to '#include <cstdint>'?" "" { target *-*-* } .-1 }
|
|
53 char bu16[(unsigned int)UINT16_MAX]; // { dg-error "'UINT16_MAX' was not declared" }
|
|
54 // { dg-message "'UINT16_MAX' is defined in header '<cstdint>'; did you forget to '#include <cstdint>'?" "" { target *-*-* } .-1 }
|
|
55 char bu32[(unsigned int)UINT32_MAX]; // { dg-error "'UINT32_MAX' was not declared" }
|
|
56 // { dg-message "'UINT32_MAX' is defined in header '<cstdint>'; did you forget to '#include <cstdint>'?" "" { target *-*-* } .-1 }
|
|
57 char bu64[(unsigned int)UINT64_MAX]; // { dg-error "'UINT64_MAX' was not declared" }
|
|
58 // { dg-message "'UINT64_MAX' is defined in header '<cstdint>'; did you forget to '#include <cstdint>'?" "" { target *-*-* } .-1 }
|
|
59
|
|
60 auto ui8 = (uint8_t) 8; // { dg-error "'uint8_t' was not declared" }
|
|
61 // { dg-message "'uint8_t' is defined in header '<cstdint>'; did you forget to '#include <cstdint>'?" "" { target *-*-* } .-1 }
|
|
62 auto ui16 = (uint16_t) 16; // { dg-error "'uint16_t' was not declared" }
|
|
63 // { dg-message "'uint16_t' is defined in header '<cstdint>'; did you forget to '#include <cstdint>'?" "" { target *-*-* } .-1 }
|
|
64 auto ui32 = (uint32_t) 32; // { dg-error "'uint32_t' was not declared" }
|
|
65 // { dg-message "'uint32_t' is defined in header '<cstdint>'; did you forget to '#include <cstdint>'?" "" { target *-*-* } .-1 }
|
|
66 auto ui64 = (uint64_t) 64; // { dg-error "'uint64_t' was not declared" }
|
|
67 // { dg-message "'uint64_t' is defined in header '<cstdint>'; did you forget to '#include <cstdint>'?" "" { target *-*-* } .-1 }
|
|
68 }
|