blob: 3e9d1883323462b39c231808439c1a1894e703a3 [file] [log] [blame]
Douglas Gregor8c700062009-04-13 21:20:57 +00001// Test this without pch.
Daniel Dunbara5728872009-12-15 20:14:24 +00002// RUN: %clang_cc1 -include %S/struct.h -fsyntax-only -verify %s
Douglas Gregor8c700062009-04-13 21:20:57 +00003
4// Test with pch.
Daniel Dunbara5728872009-12-15 20:14:24 +00005// RUN: %clang_cc1 -emit-pch -o %t %S/struct.h
6// RUN: %clang_cc1 -include-pch %t -fsyntax-only -verify %s
Douglas Gregor8c700062009-04-13 21:20:57 +00007
8struct Point *p1;
9
10float getX(struct Point *p1) {
11 return p1->x;
12}
13
14void *get_fun_ptr() {
15 return fun->is_ptr? fun->ptr : 0;
16}
17
18struct Fun2 {
19 int very_fun;
20};
21
22int get_very_fun() {
23 return fun2->very_fun;
24}
Douglas Gregor2417ef72009-04-14 17:10:28 +000025
Douglas Gregor0b748912009-04-14 21:18:50 +000026int *int_ptr_fail = &fun->is_ptr; // expected-error{{address of bit-field requested}}
27
Douglas Gregorc4741522009-04-21 22:48:38 +000028struct Nested nested = { 1, 2 };