1 // RUN: %clang_cc1 %s -fblocks -pedantic -verify -triple=x86_64-apple-darwin9
2 // RUN: %clang_cc1 %s -fblocks -pedantic -verify -triple=mips64-linux-gnu
3 // RUN: %clang_cc1 %s -fblocks -pedantic -verify -triple=x86_64-unknown-linux
4 // RUN: %clang_cc1 %s -fblocks -pedantic -verify -triple=x86_64-unknown-linux-gnux32
5 // RUN: %clang_cc1 %s -fblocks -pedantic -pedantic -verify -triple=arm64_32-apple-ios7.0
6 // RUN: %clang_cc1 %s -fblocks -pedantic -verify -triple=powerpc64-ibm-aix-xcoff
13 restrict S y
; // expected-error {{restrict requires a pointer or reference ('S' (aka 'int *[2]') is invalid)}}
17 // int128_t is available.
27 // __int128 is a keyword
31 long unsigned __int128 k
; // expected-error {{'long __int128' is invalid}}
32 int __int128
; // expected-error {{cannot combine with previous}} expected-warning {{does not declare anything}}
34 // __int128_t is __int128; __uint128_t is unsigned __int128.
35 typedef __int128 check_int_128
;
36 typedef __int128_t check_int_128
; // expected-note {{here}}
37 typedef int check_int_128
; // expected-error {{different types ('int' vs '__int128_t' (aka '__int128'))}}
39 typedef unsigned __int128 check_uint_128
;
40 typedef __uint128_t check_uint_128
; // expected-note {{here}}
41 typedef int check_uint_128
; // expected-error {{different types ('int' vs '__uint128_t' (aka 'unsigned __int128'))}}
43 // Array type merging should convert array size to whatever matches the target
50 extern int j
[sizeof(enum e
)]; // expected-note {{previous declaration}}
51 int j
[42]; // expected-error {{redefinition of 'j' with a different type: 'int[42]' vs 'int[4]'}}
54 _Decimal32 x
; // expected-error {{GNU decimal type extension not supported}}
58 int __attribute__ ((vector_size (8), vector_size (8))) v
; // expected-error {{invalid vector element type}}
61 char c
= (char __attribute__((aligned(8)))) i
; // expected-warning {{'aligned' attribute ignored when parsing type}}
64 // http://llvm.org/PR11082
66 // FIXME: This may or may not be the correct approach (no warning or error),
67 // but large amounts of Linux and FreeBSD code need this attribute to not be
68 // a hard error in order to work correctly.
70 char c
= (char __attribute__((may_alias
))) i
;
74 int __attribute__((vector_size(123456))) v1
;
75 int __attribute__((vector_size(0x1000000000))) v2
; // expected-error {{vector size too large}}
76 int __attribute__((vector_size((__int128_t
)1 << 100))) v3
; // expected-error {{vector size too large}}
77 int __attribute__((vector_size(0))) v4
; // expected-error {{zero vector size}}
78 typedef int __attribute__((ext_vector_type(123456))) e1
;
79 typedef int __attribute__((ext_vector_type(0x100000000))) e2
; // expected-error {{vector size too large}}
80 typedef int __attribute__((vector_size((__int128_t
)1 << 100))) e3
; // expected-error {{vector size too large}}
81 typedef int __attribute__((ext_vector_type(0))) e4
; // expected-error {{zero vector size}}
83 // no support for vector enum type
84 enum { e_2
} x3
__attribute__((vector_size(64))); // expected-error {{invalid vector element type}}
86 int x4
__attribute__((ext_vector_type(64))); // expected-error {{'ext_vector_type' attribute only applies to typedefs}}
89 typedef __attribute__ ((ext_vector_type(32),__aligned__(32))) unsigned char uchar32
;
93 r
.s
[ 1234 ] = 1; // expected-error {{illegal vector component name 's'}}
96 int &*_Atomic null_type_0
; // expected-error {{expected identifier or '('}}
97 int &*__restrict__ null_type_1
; // expected-error {{expected identifier or '('}}
98 int ^_Atomic null_type_2
; // expected-error {{block pointer to non-function type is invalid}}