blob: 58fd8ae84661699134906b757d553dddfdf50898 [file] [log] [blame]
Chris Lattner285d03f2009-04-11 20:52:19 +00001// Test this without pch.
Daniel Dunbara5728872009-12-15 20:14:24 +00002// RUN: %clang_cc1 -include %S/variables.h -fsyntax-only -verify %s
Chris Lattner285d03f2009-04-11 20:52:19 +00003
4// Test with pch.
Daniel Dunbara5728872009-12-15 20:14:24 +00005// RUN: %clang_cc1 -emit-pch -o %t %S/variables.h
6// RUN: %clang_cc1 -include-pch %t -fsyntax-only -verify %s
Douglas Gregor2cf26342009-04-09 22:27:44 +00007
8int *ip2 = &x;
9float *fp = &ip; // expected-warning{{incompatible pointer types}}
Douglas Gregor14f79002009-04-10 03:52:48 +000010// FIXME:variables.h expected-note{{previous}}
11double z; // expected-error{{redefinition}}
Douglas Gregor0b748912009-04-14 21:18:50 +000012// FIXME:variables.h expected-note{{previous}}
13int z2 = 18; // expected-error{{redefinition}}
Douglas Gregor0c8c4552009-04-22 00:17:41 +000014double VeryHappy; // expected-error{{redefinition}}
15// FIXME:variables.h expected-note{{previous definition is here}}
Chris Lattner531cc832009-04-10 22:13:17 +000016
17int Q = A_MACRO_IN_THE_PCH;
18
Chris Lattnerc1f9d822009-04-13 01:29:17 +000019int R = FUNCLIKE_MACRO(A_MACRO_, IN_THE_PCH);
20
21
22int UNIQUE(a); // a2
23int *Arr[] = { &a0, &a1, &a2 };