blob: f3244f7799b67ef38b37ade13ca8c08129df39d4 [file] [log] [blame]
Daniel Dunbara5728872009-12-15 20:14:24 +00001// RUN: %clang_cc1 %s -pedantic -verify -triple=x86_64-apple-darwin9
Chris Lattnerf345acc2008-12-12 05:25:55 +00002
3// rdar://6097662
4typedef int (*T)[2];
5restrict T x;
6
7typedef int *S[2];
Chris Lattnerd0344a42009-02-19 23:45:49 +00008restrict S y; // expected-error {{restrict requires a pointer or reference ('S' (aka 'int *[2]') is invalid)}}
Chris Lattnerf345acc2008-12-12 05:25:55 +00009
10
Chris Lattner2df9ced2009-04-30 02:43:43 +000011
12// int128_t is available.
13int a() {
14 __int128_t s;
15 __uint128_t t;
16}
17// but not a keyword
18int b() {
19 int __int128_t;
20 int __uint128_t;
21}
Chris Lattner38aeec72009-05-13 04:12:56 +000022
23
24// Array type merging should convert array size to whatever matches the target
25// pointer size.
26// rdar://6880874
27extern int i[1LL];
28int i[(short)1];
29
30enum e { e_1 };
31extern int j[sizeof(enum e)]; // expected-note {{previous definition}}
32int j[42]; // expected-error {{redefinition of 'j' with a different type}}
Chris Lattner8f12f652009-05-13 05:02:08 +000033
34// rdar://6880104
35_Decimal32 x; // expected-error {{GNU decimal type extension not supported}}
36
Chris Lattner82afa2d2009-05-13 05:13:44 +000037
38// rdar://6880951
Douglas Gregor27cac992010-06-30 17:30:41 +000039int __attribute__ ((vector_size (8), vector_size (8))) v; // expected-error {{invalid vector element type}}