35 lines · cpp
1// Through header not found (anywhere)2// RUN: not %clang_cc1 -emit-pch \3// RUN: -pch-through-header=Inputs/pch-does-not-exist.h -o %t %s 2>&1 \4// RUN: | FileCheck -check-prefix=CHECK-TEST0A %s5// CHECK-TEST0A: fatal error:{{.*}} 'Inputs/pch-does-not-exist.h'6// CHECK-TEST0A-SAME: required for precompiled header not found7 8// Through header not found in search path9// RUN: not %clang_cc1 -emit-pch \10// RUN: -pch-through-header=Inputs/pch-through2.h -o %t \11// RUN: %S/Inputs/pch-through-use0.cpp 2>&1 \12// RUN: | FileCheck -check-prefix=CHECK-TEST0B %s13// CHECK-TEST0B: fatal error:{{.*}}'Inputs/pch-through2.h'14// CHECK-TEST0B-SAME: required for precompiled header not found15 16// No #include of through header during pch create17// RUN: not %clang_cc1 -I %S -emit-pch \18// RUN: -pch-through-header=Inputs/pch-through2.h -o %t %s 2>&1 \19// RUN: | FileCheck -check-prefix=CHECK-TEST1A %s20// CHECK-TEST1A: fatal error:{{.*}} #include of21// CHECK-TEST1A-SAME: 'Inputs/pch-through2.h' not seen while attempting to22// CHECK-TEST1A-SAME: create precompiled header23 24// checks for through headers that are also -includes25// RUN: %clang_cc1 -I %S -include Inputs/pch-through1.h \26// RUN: -pch-through-header=Inputs/pch-through1.h -emit-pch -o %t.s3t1 %s27// RUN: %clang_cc1 -I %S -include Inputs/pch-through1.h \28// RUN: -include Inputs/pch-through2.h -include Inputs/pch-through3.h \29// RUN: -pch-through-header=Inputs/pch-through2.h -emit-pch -o %t.s3t2 %s30// Use through header from -includes31// RUN: %clang_cc1 -I %S -include Inputs/pch-through1.h \32// RUN: -include Inputs/pch-through2.h -include Inputs/pch-through4.h \33// RUN: -pch-through-header=Inputs/pch-through2.h -include-pch %t.s3t2 \34// RUN: %S/Inputs/pch-through-use2.cpp -o %t.out35