Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / clang / test / PCH / pch-hdrstop.cpp
blob5fe83a603e31026292274e1e56d6770226a402a2
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
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
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
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
21 #include "Inputs/pch-through1.h"
22 static int bar() { return 42; }
23 #include "Inputs/pch-through2.h"
24 int pch();
25 #pragma hdrstop
27 int pch() { return 42*42; }
28 int other() { return 42; }