struct.c 552 B

12345678910111213141516171819202122232425262728
  1. // Test this without pch.
  2. // RUN: %clang_cc1 -include %S/struct.h -fsyntax-only -verify %s
  3. // Test with pch.
  4. // RUN: %clang_cc1 -emit-pch -o %t %S/struct.h
  5. // RUN: %clang_cc1 -include-pch %t -fsyntax-only -verify %s
  6. struct Point *p1;
  7. float getX(struct Point *p1) {
  8. return p1->x;
  9. }
  10. void *get_fun_ptr() {
  11. return fun->is_ptr? fun->ptr : 0;
  12. }
  13. struct Fun2 {
  14. int very_fun;
  15. };
  16. int get_very_fun() {
  17. return fun2->very_fun;
  18. }
  19. int *int_ptr_fail = &fun->is_ptr; // expected-error{{address of bit-field requested}}
  20. struct Nested nested = { 1, 2 };