1; RUN: opt -module-summary -o %t.o %s
2; RUN: llvm-lto2 run -save-temps -o %t.lto.o %t.o \
3; RUN:   -r=%t.o,foo,plx \
4; RUN:   -r=%t.o,get,pl
5; RUN: llvm-dis %t.lto.o.0.2.internalize.bc >/dev/null 2>%t.dis.stderr || true
6; RUN: FileCheck -allow-empty %s < %t.dis.stderr
7
8; CHECK-NOT: Global is external, but doesn't have external or weak linkage
9
10target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
11target triple = "x86_64-unknown-linux-gnu"
12
13define i32 @foo() {
14  call void @llvm.dbg.value(metadata i32 ()* @get, metadata !7, metadata !DIExpression()), !dbg !DILocation(scope: !6)
15  ret i32 0
16}
17
18define i32 @get() {
19  ret i32 0
20}
21
22declare void @llvm.dbg.value(metadata, metadata, metadata)
23
24!llvm.dbg.cu = !{!0}
25!llvm.module.flags = !{!2, !3, !4, !5}
26
27!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !1)
28!1 = !DIFile(filename: "t.cc", directory: "/tmp/t")
29!2 = !{i32 2, !"Dwarf Version", i32 4}
30!3 = !{i32 2, !"Debug Info Version", i32 3}
31!4 = !{i32 1, !"wchar_size", i32 4}
32!5 = !{i32 1, !"ThinLTO", i32 0}
33!6 = distinct !DISubprogram(unit: !0)
34!7 = !DILocalVariable(name: "get", scope: !6)
35