Clang Project

clang_source_code/test/PCH/debug-info-pch-path.c
1// RUN: rm -rf %t
2// RUN: mkdir %t
3// RUN: cd %t
4//
5// ---------------------------------------------------------------------
6// Relative PCH, same directory.
7// ---------------------------------------------------------------------
8//
9// RUN: %clang_cc1 -fmodule-format=obj -emit-pch                \
10// RUN:     -triple %itanium_abi_triple                         \
11// RUN:     -o prefix.pch %S/debug-info-limited-struct.h
12//
13// RUN: %clang_cc1 -debug-info-kind=standalone                  \
14// RUN:     -dwarf-ext-refs -fmodule-format=obj                 \
15// RUN:     -triple %itanium_abi_triple                         \
16// RUN:     -include-pch prefix.pch %s -emit-llvm -o %t.nodir.ll %s
17// RUN: cat %t.nodir.ll | FileCheck %s --check-prefix=CHECK-REL-NODIR
18//
19//
20// CHECK-REL-NODIR: !DICompileUnit
21// CHECK-REL-NODIR-SAME:           file: ![[C:[0-9]+]]
22// CHECK-REL-NODIR-NOT: dwoId
23// CHECK-REL-NODIR: ![[C]] = !DIFile({{.*}}directory: "[[DIR:.*]]"
24// CHECK-REL-NODIR: !DICompileUnit(
25// CHECK-REL-NODIR-SAME:           file: ![[PCH:[0-9]+]]
26// CHECK-REL-NODIR-SAME:           splitDebugFilename: "prefix.pch"
27// CHECK-REL-NODIR: ![[PCH]] = !DIFile({{.*}}directory: "[[DIR]]
28
29// ---------------------------------------------------------------------
30// Relative PCH in a subdirectory.
31// ---------------------------------------------------------------------
32//
33// RUN: mkdir pchdir
34// RUN: %clang_cc1 -fmodule-format=obj -emit-pch                \
35// RUN:     -triple %itanium_abi_triple                         \
36// RUN:     -o pchdir/prefix.pch %S/debug-info-limited-struct.h
37//
38// RUN: %clang_cc1 -debug-info-kind=standalone                  \
39// RUN:     -dwarf-ext-refs -fmodule-format=obj                 \
40// RUN:     -triple %itanium_abi_triple                         \
41// RUN:     -include-pch pchdir/prefix.pch %s -emit-llvm -o %t.rel.ll %s
42// RUN: cat %t.rel.ll | FileCheck %s --check-prefix=CHECK-REL
43
44// CHECK-REL: !DICompileUnit
45// CHECK-REL-SAME:           file: ![[C:[0-9]+]]
46// CHECK-REL-NOT: dwoId
47// CHECK-REL: ![[C]] = !DIFile({{.*}}directory: "[[DIR:.*]]"
48// CHECK-REL: !DICompileUnit(
49// CHECK-REL-SAME:           file: ![[PCH:[0-9]+]]
50// CHECK-REL-SAME:           splitDebugFilename: "prefix.pch"
51// CHECK-REL: ![[PCH]] = !DIFile({{.*}}directory: "[[DIR]]{{.*}}pchdir"
52
53// ---------------------------------------------------------------------
54// Absolute PCH.
55// ---------------------------------------------------------------------
56//
57// RUN: %clang_cc1 -fmodule-format=obj -emit-pch                \
58// RUN:     -triple %itanium_abi_triple                         \
59// RUN:     -o %t/prefix.pch %S/debug-info-limited-struct.h
60//
61// RUN: %clang_cc1 -debug-info-kind=standalone                  \
62// RUN:     -dwarf-ext-refs -fmodule-format=obj                 \
63// RUN:     -triple %itanium_abi_triple                         \
64// RUN:     -include-pch %t/prefix.pch %s -emit-llvm -o %t.abs.ll %s
65// RUN: cat %t.abs.ll | FileCheck %s --check-prefix=CHECK-ABS
66
67// CHECK-ABS: !DICompileUnit
68// CHECK-ABS-SAME:           file: ![[C:[0-9]+]]
69// CHECK-ABS-NOT: dwoId
70// CHECK-ABS: ![[C]] = !DIFile({{.*}}directory: "[[DIR:.*]]"
71// CHECK-ABS: !DICompileUnit(
72// CHECK-ABS-SAME:           file: ![[PCH:[0-9]+]]
73// CHECK-ABS-SAME:           splitDebugFilename: "prefix.pch"
74// CHECK-ABS: ![[PCH]] = !DIFile({{.*}}directory: "[[DIR]]
75