1 // Test this without pch.
2 // RUN: %clang_cc1 -fblocks -include %S/types.h -fsyntax-only -verify -Wno-strict-prototypes %s
5 // RUN: %clang_cc1 -emit-pch -fblocks -Wno-strict-prototypes -o %t %S/types.h
6 // RUN: %clang_cc1 -fblocks -include-pch %t -verify -Wno-strict-prototypes %s -ast-print
11 __attribute__((address_space(1))) int int_as_one
;
14 ASInt
*as_int_ptr1
= &int_value
; // expected-error{{changes address space of pointer}}
15 ASInt
*as_int_ptr2
= &int_as_one
;
18 _Complex
float Cfloat_val
;
19 Cfloat
*Cfloat_ptr
= &Cfloat_val
;
22 _Atomic(int) AtomicInt_val
;
23 AtomicInt
*AtomicInt_ptr
= &AtomicInt_val
;
26 int_ptr int_value_ptr
= &int_value
;
29 void test_block_ptr(Block
*bl
) {
30 *bl
= ^(int x
, float f
) { return x
; };
33 // TYPE_CONSTANT_ARRAY
34 five_ints fvi
= { 1, 2, 3, 4, 5 };
36 // TYPE_INCOMPLETE_ARRAY
37 float_array fa1
= { 1, 2, 3 };
38 float_array fa2
= { 1, 2, 3, 4, 5, 6, 7, 8 };
40 // TYPE_VARIABLE_ARRAY in stmts.[ch]
43 float4 f4
= { 1.0, 2.0, 3.0, 4.0 };
46 ext_float4 ef4
= { 1.0, 2.0, 3.0, 4.0 };
48 // TYPE_FUNCTION_NO_PROTO
57 // TYPE_FUNCTION_PROTO
59 float p1(float x
, float y
, ...) {
65 int_ptr_ptr ipp
= &int_value_ptr
;
68 typeof_17
*t17
= &int_value
;
69 struct S
{ int x
, y
; };
70 typeof_17 t17_2
= (struct S
){1, 2}; // expected-error{{initializing 'typeof_17' (aka 'int') with an expression of incompatible type 'struct S'}}
73 int_ptr_ptr2 ipp2
= &int_value_ptr
;