1 // RUN: %clang_cc1 -fsyntax-only -verify -fblocks %s
3 // expected-no-diagnostics
7 void_type_class
, integer_type_class
, char_type_class
,
8 enumeral_type_class
, boolean_type_class
,
9 pointer_type_class
, reference_type_class
, offset_type_class
,
10 real_type_class
, complex_type_class
,
11 function_type_class
, method_type_class
,
12 record_type_class
, union_type_class
,
13 array_type_class
, string_type_class
,
28 enum { red
, green
, blue
} enum_obj
;
35 union { int a
; float b
; } u_obj
;
38 __attribute__((vector_size(16))) int vec
;
39 typedef __attribute__((ext_vector_type(4))) int evec_t
;
42 _Atomic
double atomic_d
;
43 _Complex
int complex_i
;
44 _Complex
double complex_d
;
46 int a1
[__builtin_classify_type(f()) == void_type_class
? 1 : -1];
47 int a2
[__builtin_classify_type(i
) == integer_type_class
? 1 : -1];
48 int a3
[__builtin_classify_type(c
) == integer_type_class
? 1 : -1];
49 int a4
[__builtin_classify_type(enum_obj
) == enumeral_type_class
? 1 : -1];
50 int a5
[__builtin_classify_type(b
) == boolean_type_class
? 1 : -1];
51 int a6
[__builtin_classify_type(p
) == pointer_type_class
? 1 : -1];
52 int a7
[__builtin_classify_type(r
) == integer_type_class
? 1 : -1];
53 int a8
[__builtin_classify_type(&cl::baz
) == offset_type_class
? 1 : -1];
54 int a9
[__builtin_classify_type(d
) == real_type_class
? 1 : -1];
55 int a10
[__builtin_classify_type(f
) == pointer_type_class
? 1 : -1];
56 int a11
[__builtin_classify_type(&cl::bar
) == record_type_class
? 1 : -1];
57 int a12
[__builtin_classify_type(cl_obj
) == record_type_class
? 1 : -1];
58 int a13
[__builtin_classify_type(u_obj
) == union_type_class
? 1 : -1];
59 int a14
[__builtin_classify_type(arr
) == pointer_type_class
? 1 : -1];
60 int a15
[__builtin_classify_type("abc") == pointer_type_class
? 1 : -1];
61 int a16
[__builtin_classify_type(block
) == no_type_class
? 1 : -1];
62 int a17
[__builtin_classify_type(vec
) == no_type_class
? 1 : -1];
63 int a18
[__builtin_classify_type(evec
) == no_type_class
? 1 : -1];
64 int a19
[__builtin_classify_type(atomic_i
) == integer_type_class
? 1 : -1];
65 int a20
[__builtin_classify_type(atomic_d
) == real_type_class
? 1 : -1];
66 int a21
[__builtin_classify_type(complex_i
) == complex_type_class
? 1 : -1];
67 int a22
[__builtin_classify_type(complex_d
) == complex_type_class
? 1 : -1];