1*67e74705SXin Li // Test with pch. 2*67e74705SXin Li // RUN: %clang_cc1 -emit-pch -DFOO -o %t %S/variables.h 3*67e74705SXin Li // RUN: %clang_cc1 -DBAR=int -include-pch %t -fsyntax-only -pedantic %s 4*67e74705SXin Li // RUN: %clang_cc1 -DFOO -DBAR=int -include-pch %t %s 5*67e74705SXin Li // RUN: not %clang_cc1 -DFOO=blah -DBAR=int -include-pch %t %s 2> %t.err 6*67e74705SXin Li // RUN: FileCheck -check-prefix=CHECK-FOO %s < %t.err 7*67e74705SXin Li // RUN: not %clang_cc1 -UFOO -include-pch %t %s 2> %t.err 8*67e74705SXin Li // RUN: FileCheck -check-prefix=CHECK-NOFOO %s < %t.err 9*67e74705SXin Li 10*67e74705SXin Li // RUN: not %clang_cc1 -DFOO -undef -include-pch %t %s 2> %t.err 11*67e74705SXin Li // RUN: FileCheck -check-prefix=CHECK-UNDEF %s < %t.err 12*67e74705SXin Li 13*67e74705SXin Li BAR bar = 17; 14*67e74705SXin Li 15*67e74705SXin Li #ifndef FOO 16*67e74705SXin Li # error FOO was not defined 17*67e74705SXin Li #endif 18*67e74705SXin Li 19*67e74705SXin Li #if FOO != 1 20*67e74705SXin Li # error FOO has the wrong definition 21*67e74705SXin Li #endif 22*67e74705SXin Li 23*67e74705SXin Li #ifndef BAR 24*67e74705SXin Li # error BAR was not defined 25*67e74705SXin Li #endif 26*67e74705SXin Li 27*67e74705SXin Li // CHECK-FOO: definition of macro 'FOO' differs between the precompiled header ('1') and the command line ('blah') 28*67e74705SXin Li // CHECK-NOFOO: macro 'FOO' was defined in the precompiled header but undef'd on the command line 29*67e74705SXin Li 30*67e74705SXin Li // CHECK-UNDEF: command line contains '-undef' but precompiled header was not built with it 31*67e74705SXin Li 32