1*0a6a1f1dSLionel Sambuc // RUN: %clang_cc1 -target-linker-version 100 -emit-pch %s -o %t.h.pch 2*0a6a1f1dSLionel Sambuc // RUN: %clang_cc1 -target-linker-version 200 %s -include-pch %t.h.pch -fsyntax-only -verify 3*0a6a1f1dSLionel Sambuc 4*0a6a1f1dSLionel Sambuc #ifndef HEADER 5*0a6a1f1dSLionel Sambuc #define HEADER 6*0a6a1f1dSLionel Sambuc 7*0a6a1f1dSLionel Sambuc extern int foo; 8*0a6a1f1dSLionel Sambuc 9*0a6a1f1dSLionel Sambuc #else 10*0a6a1f1dSLionel Sambuc f()11*0a6a1f1dSLionel Sambucvoid f() { 12*0a6a1f1dSLionel Sambuc int a = foo; 13*0a6a1f1dSLionel Sambuc // Make sure we parsed this by getting an error. 14*0a6a1f1dSLionel Sambuc int b = bar; // expected-error {{undeclared}} 15*0a6a1f1dSLionel Sambuc } 16*0a6a1f1dSLionel Sambuc 17*0a6a1f1dSLionel Sambuc #endif 18