xref: /llvm-project/clang/test/Modules/debug-info-moduleimport.m (revision 7793e676514bc102e97a993e90257e8628069a8b)
1// UNSUPPORTED: target={{.*}}-zos{{.*}}, target={{.*}}-aix{{.*}}
2// RUN: rm -rf %t
3// RUN: %clang_cc1 -debug-info-kind=limited -fmodules \
4// RUN:     -DGREETING="Hello World" -UNDEBUG \
5// RUN:     -fimplicit-module-maps -fmodules-cache-path=%t %s \
6// RUN:     -I %S/Inputs -isysroot /tmp/.. -I %t -emit-llvm -o - \
7// RUN:     | FileCheck %s --check-prefix=NOIMPORT
8
9// NOIMPORT-NOT: !DIImportedEntity
10// NOIMPORT-NOT: !DIModule
11
12// RUN: rm -rf %t
13// RUN: %clang_cc1 -debug-info-kind=limited -fmodules \
14// RUN:    -DGREETING="Hello World" -UNDEBUG \
15// RUN:    -fimplicit-module-maps -fmodules-cache-path=%t %s \
16// RUN:    -I %S/Inputs -isysroot /tmp/.. -I %t -emit-llvm \
17// RUN:    -debugger-tuning=lldb -o - | FileCheck %s
18
19// CHECK: ![[CU:.*]] = distinct !DICompileUnit
20// CHECK-SAME:  sysroot: "/tmp/..")
21@import DebugObjC;
22// CHECK: !DIImportedEntity(tag: DW_TAG_imported_declaration, scope: ![[CU]],
23// CHECK-SAME:              entity: ![[MODULE:.*]], file: ![[F:[0-9]+]],
24// CHECK-SAME:              line: [[@LINE-3]])
25// CHECK: ![[MODULE]] = !DIModule(scope: null, name: "DebugObjC",
26// CHECK-SAME:  configMacros: "\22-DGREETING=Hello World\22 \22-UNDEBUG\22",
27// CHECK-SAME:  includePath: "{{.*}}test{{.*}}Modules{{.*}}Inputs"
28// CHECK: ![[F]] = !DIFile(filename: {{.*}}debug-info-moduleimport.m
29
30// RUN: %clang_cc1 -debug-info-kind=limited -fmodules -fimplicit-module-maps \
31// RUN:   -fmodules-cache-path=%t %s -I %S/Inputs -isysroot /tmp/.. -I %t \
32// RUN:   -emit-llvm -o - | FileCheck %s --check-prefix=NO-SKEL-CHECK
33// NO-SKEL-CHECK: distinct !DICompileUnit
34// NO-SKEL-CHECK-NOT: distinct !DICompileUnit
35
36// RUN: %clang_cc1 -debug-info-kind=limited -fmodules -fimplicit-module-maps \
37// RUN:   -fmodules-cache-path=%t -fdebug-prefix-map=%t=/MODULE-CACHE \
38// RUN:   -fdebug-prefix-map=%S=/SRCDIR \
39// RUN:   -fmodule-format=obj -dwarf-ext-refs \
40// RUN:   %s -I %S/Inputs -isysroot /tmp/.. -I %t -emit-llvm -o - \
41// RUN:     | FileCheck %s --check-prefix=SKEL-CHECK
42// SKEL-CHECK: includePath: "/SRCDIR/Inputs"
43// SKEL-CHECK: distinct !DICompileUnit({{.*}}file: ![[CUFILE:[0-9]+]]
44// SKEL-CHECK: ![[CUFILE]] = !DIFile({{.*}}directory: "[[COMP_DIR:.*]]"
45// SKEL-CHECK: distinct !DICompileUnit({{.*}}file: ![[DWOFILE:[0-9]+]]{{.*}}splitDebugFilename: "/MODULE-CACHE{{.*}}dwoId
46// SKEL-CHECK: ![[DWOFILE]] = !DIFile({{.*}}directory: "[[COMP_DIR]]"
47