types.c revision e82247a71a1a76e78f3b979b64d5f6412ab40266
1// RUN: %clang_cc1 %s -pedantic -verify -triple=x86_64-apple-darwin9 2 3// rdar://6097662 4typedef int (*T)[2]; 5restrict T x; 6 7typedef int *S[2]; 8restrict S y; // expected-error {{restrict requires a pointer or reference ('S' (aka 'int *[2]') is invalid)}} 9 10 11 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} 22 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}} 33 34// rdar://6880104 35_Decimal32 x; // expected-error {{GNU decimal type extension not supported}} 36 37 38// rdar://6880951 39int __attribute__ ((vector_size (8), vector_size (8))) v; // expected-error {{invalid vector element type}} 40 41void test(int i) { 42 char c = (char __attribute__((align(8)))) i; // expected-error {{'align' attribute ignored when parsing type}} 43} 44