xref: /llvm-project/llvm/test/ThinLTO/X86/Inputs/index-const-prop.ll (revision d5d3eb16b7ab72529c83dacb2889811491e48909)
1target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
2target triple = "x86_64-pc-linux-gnu"
3
4@gBar = local_unnamed_addr global i32 2, align 4, !dbg !0
5@gFoo = internal unnamed_addr global i32 1, align 4, !dbg !6
6
7; Function Attrs: norecurse nounwind readonly
8define i32 @foo() local_unnamed_addr #0 !dbg !14 {
9  %1 = load i32, ptr @gFoo, align 4, !dbg !17
10  ret i32 %1, !dbg !18
11}
12
13; Function Attrs: norecurse nounwind readonly
14define i32 @bar() local_unnamed_addr #0 !dbg !19 {
15  %1 = load i32, ptr @gBar, align 4, !dbg !20
16  ret i32 %1, !dbg !21
17}
18
19define void @baz() local_unnamed_addr !dbg !22 {
20  %1 = tail call i32 @rand(), !dbg !25
21  store i32 %1, ptr @gFoo, align 4, !dbg !26
22  %2 = tail call i32 @rand(), !dbg !27
23  store i32 %2, ptr @gBar, align 4, !dbg !28
24  ret void, !dbg !29
25}
26
27declare i32 @rand() local_unnamed_addr
28
29attributes #0 = { norecurse nounwind readonly }
30
31!llvm.dbg.cu = !{!2}
32!llvm.module.flags = !{!9, !10, !11, !12}
33!llvm.ident = !{!13}
34
35!0 = !DIGlobalVariableExpression(var: !1, expr: !DIExpression())
36!1 = distinct !DIGlobalVariable(name: "gBar", scope: !2, file: !3, line: 4, type: !8, isLocal: false, isDefinition: true)
37!2 = distinct !DICompileUnit(language: DW_LANG_C99, file: !3, producer: "clang version 7.0.0 (trunk 332246)", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !4, globals: !5)
38!3 = !DIFile(filename: "foo.c", directory: "/data/work/lto/roref/test")
39!4 = !{}
40!5 = !{!0, !6}
41!6 = !DIGlobalVariableExpression(var: !7, expr: !DIExpression())
42!7 = distinct !DIGlobalVariable(name: "gFoo", scope: !2, file: !3, line: 3, type: !8, isLocal: true, isDefinition: true)
43!8 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)
44!9 = !{i32 2, !"Dwarf Version", i32 4}
45!10 = !{i32 2, !"Debug Info Version", i32 3}
46!11 = !{i32 1, !"wchar_size", i32 4}
47!12 = !{i32 7, !"PIC Level", i32 2}
48!13 = !{!"clang version 7.0.0 (trunk 332246)"}
49!14 = distinct !DISubprogram(name: "foo", scope: !3, file: !3, line: 6, type: !15, isLocal: false, isDefinition: true, scopeLine: 6, isOptimized: true, unit: !2, retainedNodes: !4)
50!15 = !DISubroutineType(types: !16)
51!16 = !{!8}
52!17 = !DILocation(line: 7, column: 10, scope: !14)
53!18 = !DILocation(line: 7, column: 3, scope: !14)
54!19 = distinct !DISubprogram(name: "bar", scope: !3, file: !3, line: 10, type: !15, isLocal: false, isDefinition: true, scopeLine: 10, isOptimized: true, unit: !2, retainedNodes: !4)
55!20 = !DILocation(line: 11, column: 10, scope: !19)
56!21 = !DILocation(line: 11, column: 3, scope: !19)
57!22 = distinct !DISubprogram(name: "baz", scope: !3, file: !3, line: 14, type: !23, isLocal: false, isDefinition: true, scopeLine: 14, isOptimized: true, unit: !2, retainedNodes: !4)
58!23 = !DISubroutineType(types: !24)
59!24 = !{null}
60!25 = !DILocation(line: 15, column: 10, scope: !22)
61!26 = !DILocation(line: 15, column: 8, scope: !22)
62!27 = !DILocation(line: 16, column: 10, scope: !22)
63!28 = !DILocation(line: 16, column: 8, scope: !22)
64!29 = !DILocation(line: 17, column: 1, scope: !22)
65