Daniel Dunbar | a572887 | 2009-12-15 20:14:24 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 %s -pedantic -verify -triple=x86_64-apple-darwin9 |
Chris Lattner | f345acc | 2008-12-12 05:25:55 +0000 | [diff] [blame] | 2 | |
| 3 | // rdar://6097662 |
| 4 | typedef int (*T)[2]; |
| 5 | restrict T x; |
| 6 | |
| 7 | typedef int *S[2]; |
Chris Lattner | d0344a4 | 2009-02-19 23:45:49 +0000 | [diff] [blame] | 8 | restrict S y; // expected-error {{restrict requires a pointer or reference ('S' (aka 'int *[2]') is invalid)}} |
Chris Lattner | f345acc | 2008-12-12 05:25:55 +0000 | [diff] [blame] | 9 | |
| 10 | |
Chris Lattner | 2df9ced | 2009-04-30 02:43:43 +0000 | [diff] [blame] | 11 | |
| 12 | // int128_t is available. |
| 13 | int a() { |
| 14 | __int128_t s; |
| 15 | __uint128_t t; |
| 16 | } |
| 17 | // but not a keyword |
| 18 | int b() { |
| 19 | int __int128_t; |
| 20 | int __uint128_t; |
| 21 | } |
Chris Lattner | 38aeec7 | 2009-05-13 04:12:56 +0000 | [diff] [blame] | 22 | |
| 23 | |
| 24 | // Array type merging should convert array size to whatever matches the target |
| 25 | // pointer size. |
| 26 | // rdar://6880874 |
| 27 | extern int i[1LL]; |
| 28 | int i[(short)1]; |
| 29 | |
| 30 | enum e { e_1 }; |
| 31 | extern int j[sizeof(enum e)]; // expected-note {{previous definition}} |
| 32 | int j[42]; // expected-error {{redefinition of 'j' with a different type}} |
Chris Lattner | 8f12f65 | 2009-05-13 05:02:08 +0000 | [diff] [blame] | 33 | |
| 34 | // rdar://6880104 |
| 35 | _Decimal32 x; // expected-error {{GNU decimal type extension not supported}} |
| 36 | |
Chris Lattner | 82afa2d | 2009-05-13 05:13:44 +0000 | [diff] [blame] | 37 | |
| 38 | // rdar://6880951 |
Douglas Gregor | 27cac99 | 2010-06-30 17:30:41 +0000 | [diff] [blame] | 39 | int __attribute__ ((vector_size (8), vector_size (8))) v; // expected-error {{invalid vector element type}} |