1*2623e140SErich Keane // Create
2*2623e140SErich Keane // RUN: %clang_cc1 -I %S -emit-pch \
3*2623e140SErich Keane // RUN:   -pch-through-header=Inputs/pch-through2.h -o %t.1 %s
4*2623e140SErich Keane 
5*2623e140SErich Keane // Use
6*2623e140SErich Keane // RUN: %clang_cc1 -I %S -include-pch %t.1 \
7*2623e140SErich Keane // RUN:   -pch-through-header=Inputs/pch-through2.h %s
8*2623e140SErich Keane 
9*2623e140SErich Keane // No #include of through header during pch use
10*2623e140SErich Keane // RUN: not %clang_cc1 -I %S -include-pch %t.1 \
11*2623e140SErich Keane // RUN:   -pch-through-header=Inputs/pch-through2.h \
12*2623e140SErich Keane // RUN:   %S/Inputs/pch-through-use1.cpp 2>&1 \
13*2623e140SErich Keane // RUN:   | FileCheck -check-prefix=CHECK-TEST2A %s
14*2623e140SErich Keane // CHECK-TEST2A: fatal error:{{.*}} #include of
15*2623e140SErich Keane // CHECK-TEST2A-SAME: 'Inputs/pch-through2.h' not seen while attempting to
16*2623e140SErich Keane // CHECK-TEST2A-SAME: use precompiled header
17*2623e140SErich Keane 
18*2623e140SErich Keane // check that pch only contains code before the through header.
19*2623e140SErich Keane // RUN: %clang_cc1 -I %S -emit-pch \
20*2623e140SErich Keane // RUN:   -pch-through-header=Inputs/pch-through1.h -o %t.2 %s
21*2623e140SErich Keane // RUN: not %clang_cc1 -I %S -include-pch %t.2 \
22*2623e140SErich Keane // RUN:   -pch-through-header=Inputs/pch-through1.h \
23*2623e140SErich Keane // RUN:   %S/Inputs/pch-through-use1.cpp 2>&1 \
24*2623e140SErich Keane // RUN:   | FileCheck -check-prefix=CHECK-TEST3 %s
25*2623e140SErich Keane // CHECK-TEST3: error: use of undeclared identifier 'through2'
26*2623e140SErich Keane 
27*2623e140SErich Keane #include "Inputs/pch-through1.h"
28*2623e140SErich Keane #include "Inputs/pch-through2.h"
29