xref: /llvm-project/llvm/test/LTO/X86/strip-debug-info.ll (revision a4d3bc68142e67c1cbceef3ac33cdaf9b78fd84a)
1; RUN: llvm-as -disable-verify %s -o %t.bc
2; ---- Full LTO ---------------------------------------------
3; RUN: llvm-lto \
4; RUN:     -exported-symbol foo -exported-symbol _foo \
5; RUN:     -o %t.o %t.bc 2>&1 | \
6; RUN:     FileCheck %s -allow-empty -check-prefix=CHECK-WARN
7; RUN: llvm-nm %t.o | FileCheck %s
8; ---- Thin LTO (codegen only) ------------------------------
9; RUN: llvm-lto -thinlto -thinlto-action=codegen \
10; RUN:     %t.bc -disable-verify 2>&1 | \
11; RUN:     FileCheck %s -allow-empty -check-prefix=CHECK-WARN
12; ---- Thin LTO (optimize, strip main file) -----------------
13; RUN: opt -disable-verify -disable-upgrade-debug-info -module-summary %s -o %t.bc
14; RUN: opt -disable-verify -disable-upgrade-debug-info -module-summary %S/Inputs/strip-debug-info-bar.ll \
15; RUN:     -o %t2.bc
16; RUN: llvm-lto -thinlto -thinlto-action=run \
17; RUN:     %t.bc -disable-verify 2>&1 | \
18; RUN:     FileCheck %s -allow-empty -check-prefix=CHECK-WARN
19; ---- Thin LTO (optimize, strip imported file) -------------
20; RUN: opt -module-summary %t.bc -o %t-stripped.bc
21; RUN: llvm-lto -thinlto-action=thinlink -o %t.index.bc %t-stripped.bc %t2.bc
22; RUN: llvm-lto -thinlto -thinlto-action=import \
23; RUN:     -thinlto-index=%t.index.bc \
24; RUN:     -exported-symbol foo -exported-symbol _foo \
25; RUN:     %t-stripped.bc -disable-verify 2>&1 | \
26; RUN:     FileCheck %s -allow-empty -check-prefix=CHECK-WARN
27; ---- Thin LTO (optimize, don't strip imported file)
28; RUN: llvm-lto -thinlto-action=thinlink -o %t.index.bc %t-stripped.bc %t2.bc
29; RUN: llvm-lto -thinlto -thinlto-action=import -disable-auto-upgrade-debug-info \
30; RUN:     -thinlto-index=%t.index.bc \
31; RUN:     -exported-symbol foo -exported-symbol _foo \
32; RUN:     %t-stripped.bc -disable-verify 2>&1 | \
33; RUN:     FileCheck %s -allow-empty -check-prefix=CHECK-NO-WARN
34
35; CHECK-WARN: warning{{.*}} ignoring invalid debug info
36; CHECK-WARN-NOT: Broken module found
37; CHECK: foo
38; CHECK-NO-WARN-NOT: ignoring invalid debug info
39target datalayout = "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
40target triple = "x86_64-apple-macosx10.12"
41
42declare void @bar()
43
44define void @foo() {
45  call void @bar()
46  ret void
47}
48
49!llvm.module.flags = !{!0}
50!llvm.dbg.cu = !{!1}
51
52!0 = !{i32 2, !"Debug Info Version", i32 3}
53!1 = !DIFile(filename: "broken", directory: "")
54