1 // RUN: %clang_cc1 -fsyntax-only -verify %s -fblocks
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
,
20 enum { red
, green
, blue
} enum_obj
;
25 struct { int a
; float b
; } s_obj
;
26 union { int a
; float b
; } u_obj
;
29 __attribute__((vector_size(16))) int vec
;
30 typedef __attribute__((ext_vector_type(4))) int evec_t
;
32 typedef _BitInt(8) int8_t3
__attribute__((ext_vector_type(3)));
34 typedef _BitInt(16) int16_t3
__attribute__((ext_vector_type(4)));
36 typedef _BitInt(32) int32_t3
__attribute__((ext_vector_type(5)));
38 typedef _BitInt(64) int64_t3
__attribute__((ext_vector_type(6)));
40 typedef _BitInt(8) vint8_t3
__attribute__((vector_size(3)));
42 typedef _BitInt(16) vint16_t3
__attribute__((vector_size(4)));
44 typedef _BitInt(32) vint32_t3
__attribute__((vector_size(8)));
46 typedef _BitInt(64) vint64_t3
__attribute__((vector_size(16)));
50 _Atomic
double atomic_d
;
51 _Complex
int complex_i
;
52 _Complex
double complex_d
;
54 int a1
[__builtin_classify_type(f()) == void_type_class
? 1 : -1];
55 int a2
[__builtin_classify_type(i
) == integer_type_class
? 1 : -1];
56 int a3
[__builtin_classify_type(c
) == integer_type_class
? 1 : -1];
57 int a4
[__builtin_classify_type(enum_obj
) == integer_type_class
? 1 : -1];
58 int a5
[__builtin_classify_type(p
) == pointer_type_class
? 1 : -1];
59 int a6
[__builtin_classify_type(d
) == real_type_class
? 1 : -1];
60 int a7
[__builtin_classify_type(cc
) == complex_type_class
? 1 : -1];
61 int a8
[__builtin_classify_type(f
) == pointer_type_class
? 1 : -1];
62 int a0
[__builtin_classify_type(s_obj
) == record_type_class
? 1 : -1];
63 int a10
[__builtin_classify_type(u_obj
) == union_type_class
? 1 : -1];
64 int a11
[__builtin_classify_type(arr
) == pointer_type_class
? 1 : -1];
65 int a12
[__builtin_classify_type("abc") == pointer_type_class
? 1 : -1];
66 int a13
[__builtin_classify_type(block
) == no_type_class
? 1 : -1];
67 int a14
[__builtin_classify_type(vec
) == no_type_class
? 1 : -1];
68 int a15
[__builtin_classify_type(evec
) == no_type_class
? 1 : -1];
69 int a16
[__builtin_classify_type(atomic_i
) == integer_type_class
? 1 : -1];
70 int a17
[__builtin_classify_type(atomic_d
) == real_type_class
? 1 : -1];
71 int a18
[__builtin_classify_type(complex_i
) == complex_type_class
? 1 : -1];
72 int a19
[__builtin_classify_type(complex_d
) == complex_type_class
? 1 : -1];
75 extern int (^p
)(void);
76 int n
= __builtin_classify_type(p
);