blob: 120db0e82b965a92a1bb099d4e9f6a968561f933 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
// This test is the PCH version of Modules/codegen-flags.test . It uses its inputs.
// The purpose of this test is just verify that the codegen options work with PCH as well.
// All the codegen functionality should be tested in Modules/.
// RUN: rm -rf %t
// RUN: mkdir -p %t
// REQUIRES: x86-registered-target
// 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
// 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
// RUN: %clang_cc1 -triple x86_64-linux-gnu -emit-llvm -debug-info-kind=limited -o - %s -include-pch %t/foo-cg.pch -building-pch-with-obj -fmodules-codegen | FileCheck --check-prefix=CG %s
// RUN: %clang_cc1 -triple x86_64-linux-gnu -emit-llvm -debug-info-kind=limited -o - %s -include-pch %t/foo-di.pch -building-pch-with-obj -fmodules-debuginfo | FileCheck --check-prefix=DI %s
// 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
// 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
// CG: define weak_odr void @_Z2f1v
// CG: DICompileUnit
// CG-NOT: DICompositeType
// CG-USE: declare void @_Z2f1v
// CG-USE: DICompileUnit
// CG-USE: distinct !DICompositeType(tag: DW_TAG_structure_type, name: "foo"
// DI-NOT: define
// DI: distinct !DICompositeType(tag: DW_TAG_structure_type, name: "foo"
// DI-USE: define linkonce_odr void @_Z2f1v
// DI-USE: = !DICompositeType(tag: DW_TAG_structure_type, name: "foo", {{.*}}, flags: DIFlagFwdDecl
|