| 1 | // expected-no-diagnostics |
| 2 | // Create PCH with #pragma hdrstop |
| 3 | // RUN: %clang_cc1 -verify -I %S -emit-pch -pch-through-hdrstop-create \ |
| 4 | // RUN: -fms-extensions -o %t.pch -x c++-header %s |
| 5 | |
| 6 | // Create PCH object with #pragma hdrstop |
| 7 | // RUN: %clang_cc1 -verify -I %S -emit-obj -include-pch %t.pch \ |
| 8 | // RUN: -pch-through-hdrstop-create -fms-extensions -o %t.obj -x c++ %s |
| 9 | |
| 10 | // Use PCH with #pragma hdrstop |
| 11 | // RUN: %clang_cc1 -verify -I %S -emit-obj -include-pch %t.pch \ |
| 12 | // RUN: -pch-through-hdrstop-use -fms-extensions -o %t.obj \ |
| 13 | // RUN: -x c++ %S/Inputs/pch-hdrstop-use.cpp |
| 14 | |
| 15 | // Ensure the PCH stops at the hdrstop |
| 16 | // RUN: %clang_cc1 -ast-dump -I %S -include-pch %t.pch \ |
| 17 | // RUN: -pch-through-hdrstop-use -fms-extensions -o %t.obj \ |
| 18 | // RUN: -x c++ %S/Inputs/pch-hdrstop-use.cpp 2>&1 \ |
| 19 | // RUN: | FileCheck %S/Inputs/pch-hdrstop-use.cpp |
| 20 | |
| 21 | #include "Inputs/pch-through1.h" |
| 22 | static int bar() { return 42; } |
| 23 | #include "Inputs/pch-through2.h" |
| 24 | int pch(); |
| 25 | #pragma hdrstop |
| 26 | |
| 27 | int pch() { return 42*42; } |
| 28 | int other() { return 42; } |
| 29 | |