| 1 |
// This test is the PCH version of Modules/codegen-flags.test . It uses its inputs. |
| 2 |
// The purpose of this test is just verify that the codegen options work with PCH as well. |
| 3 |
// All the codegen functionality should be tested in Modules/. |
| 4 |
|
| 5 |
// RUN: rm -rf %t |
| 6 |
// RUN: mkdir -p %t |
| 7 |
// REQUIRES: x86-registered-target |
| 8 |
|
| 9 |
// RUN: %clang_cc1 -triple=x86_64-linux-gnu -fmodules-codegen -x c++-header -building-pch-with-obj -emit-pch %S/../Modules/Inputs/codegen-flags/foo.h -o %t/foo-cg.pch |
| 10 |
// RUN: %clang_cc1 -triple=x86_64-linux-gnu -fmodules-debuginfo -x c++-header -building-pch-with-obj -emit-pch %S/../Modules/Inputs/codegen-flags/foo.h -o %t/foo-di.pch |
| 11 |
|
| 12 |
// RUN: %clang_cc1 -triple x86_64-linux-gnu -emit-llvm -debug-info-kind=limited -o - -x precompiled-header %t/foo-cg.pch | FileCheck --check-prefix=CG %s |
| 13 |
// RUN: %clang_cc1 -triple x86_64-linux-gnu -emit-llvm -debug-info-kind=limited -o - -x precompiled-header %t/foo-di.pch | FileCheck --check-prefix=DI %s |
| 14 |
|
| 15 |
// RUN: %clang_cc1 -triple x86_64-linux-gnu -emit-llvm -debug-info-kind=limited -o - -include-pch %t/foo-cg.pch %S/../Modules/Inputs/codegen-flags/use.cpp | FileCheck --check-prefix=CG-USE %s |
| 16 |
// RUN: %clang_cc1 -triple x86_64-linux-gnu -emit-llvm -debug-info-kind=limited -o - -include-pch %t/foo-di.pch %S/../Modules/Inputs/codegen-flags/use.cpp | FileCheck --check-prefix=DI-USE %s |
| 17 |
|
| 18 |
// Test with template instantiation in the pch. |
| 19 |
|
| 20 |
// RUN: %clang_cc1 -triple=x86_64-linux-gnu -fmodules-codegen -x c++-header -building-pch-with-obj -emit-pch -fpch-instantiate-templates %S/../Modules/Inputs/codegen-flags/foo.h -o %t/foo-cg.pch |
| 21 |
// RUN: %clang_cc1 -triple=x86_64-linux-gnu -fmodules-debuginfo -x c++-header -building-pch-with-obj -emit-pch -fpch-instantiate-templates %S/../Modules/Inputs/codegen-flags/foo.h -o %t/foo-di.pch |
| 22 |
|
| 23 |
// RUN: %clang_cc1 -triple x86_64-linux-gnu -emit-llvm -debug-info-kind=limited -o - -x precompiled-header %t/foo-cg.pch | FileCheck --check-prefix=CG %s |
| 24 |
// RUN: %clang_cc1 -triple x86_64-linux-gnu -emit-llvm -debug-info-kind=limited -o - -x precompiled-header %t/foo-di.pch | FileCheck --check-prefix=DI %s |
| 25 |
|
| 26 |
// RUN: %clang_cc1 -triple x86_64-linux-gnu -emit-llvm -debug-info-kind=limited -o - -include-pch %t/foo-cg.pch %S/../Modules/Inputs/codegen-flags/use.cpp | FileCheck --check-prefix=CG-USE %s |
| 27 |
// RUN: %clang_cc1 -triple x86_64-linux-gnu -emit-llvm -debug-info-kind=limited -o - -include-pch %t/foo-di.pch %S/../Modules/Inputs/codegen-flags/use.cpp | FileCheck --check-prefix=DI-USE %s |
| 28 |
|
| 29 |
|
| 30 |
// CG: define weak_odr void @_Z2f1v |
| 31 |
// CG: DICompileUnit |
| 32 |
// CG-NOT: DICompositeType |
| 33 |
|
| 34 |
// CG-USE: declare void @_Z2f1v |
| 35 |
// CG-USE: DICompileUnit |
| 36 |
// CG-USE: distinct !DICompositeType(tag: DW_TAG_structure_type, name: "foo" |
| 37 |
|
| 38 |
// DI-NOT: define |
| 39 |
// DI: distinct !DICompositeType(tag: DW_TAG_structure_type, name: "foo" |
| 40 |
|
| 41 |
// DI-USE: define linkonce_odr void @_Z2f1v |
| 42 |
// DI-USE: = !DICompositeType(tag: DW_TAG_structure_type, name: "foo", {{.*}}, flags: DIFlagFwdDecl |