Chris Lattner | 285d03f | 2009-04-11 20:52:19 +0000 | [diff] [blame] | 1 | // Test this without pch. |
Daniel Dunbar | a572887 | 2009-12-15 20:14:24 +0000 | [diff] [blame] | 2 | // RUN: %clang_cc1 -include %S/variables.h -fsyntax-only -verify %s |
Chris Lattner | 285d03f | 2009-04-11 20:52:19 +0000 | [diff] [blame] | 3 | |
| 4 | // Test with pch. |
Daniel Dunbar | a572887 | 2009-12-15 20:14:24 +0000 | [diff] [blame] | 5 | // RUN: %clang_cc1 -emit-pch -o %t %S/variables.h |
| 6 | // RUN: %clang_cc1 -include-pch %t -fsyntax-only -verify %s |
Douglas Gregor | 2cf2634 | 2009-04-09 22:27:44 +0000 | [diff] [blame] | 7 | |
| 8 | int *ip2 = &x; |
| 9 | float *fp = &ip; // expected-warning{{incompatible pointer types}} |
Douglas Gregor | 14f7900 | 2009-04-10 03:52:48 +0000 | [diff] [blame] | 10 | // FIXME:variables.h expected-note{{previous}} |
| 11 | double z; // expected-error{{redefinition}} |
Douglas Gregor | 0b74891 | 2009-04-14 21:18:50 +0000 | [diff] [blame] | 12 | // FIXME:variables.h expected-note{{previous}} |
| 13 | int z2 = 18; // expected-error{{redefinition}} |
Douglas Gregor | 0c8c455 | 2009-04-22 00:17:41 +0000 | [diff] [blame] | 14 | double VeryHappy; // expected-error{{redefinition}} |
| 15 | // FIXME:variables.h expected-note{{previous definition is here}} |
Chris Lattner | 531cc83 | 2009-04-10 22:13:17 +0000 | [diff] [blame] | 16 | |
| 17 | int Q = A_MACRO_IN_THE_PCH; |
| 18 | |
Chris Lattner | c1f9d82 | 2009-04-13 01:29:17 +0000 | [diff] [blame] | 19 | int R = FUNCLIKE_MACRO(A_MACRO_, IN_THE_PCH); |
| 20 | |
| 21 | |
| 22 | int UNIQUE(a); // a2 |
| 23 | int *Arr[] = { &a0, &a1, &a2 }; |