]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - test/Transforms/GlobalOpt/integer-bool-dwarf.ll
Vendor import of llvm trunk r338150:
[FreeBSD/FreeBSD.git] / test / Transforms / GlobalOpt / integer-bool-dwarf.ll
1 ;RUN: opt -S -globalopt -f %s | FileCheck %s
2
3 ;CHECK: @foo = internal unnamed_addr global i1 false, align 4, !dbg ![[VAR:.*]]
4 ;CHECK: ![[VAR]] = !DIGlobalVariableExpression(var: !1, expr:
5 ;CHECK-SAME: !DIExpression(DW_OP_deref, DW_OP_constu, 111, DW_OP_mul,
6 ;CHECK-SAME:               DW_OP_constu, 0, DW_OP_plus, DW_OP_stack_value,
7 ;CHECK-SAME:               DW_OP_LLVM_fragment, 0, 1)) 
8
9 @foo = internal global i32 0, align 4, !dbg !0
10
11 ; Function Attrs: noinline nounwind optnone uwtable
12 define void @set1() #0 !dbg !11 {
13 entry:
14   store i32 111, i32* @foo, align 4, !dbg !14
15   ret void, !dbg !15
16 }
17
18 ; Function Attrs: noinline nounwind optnone uwtable
19 define void @set2() #0 !dbg !16 {
20 entry:
21   store i32 0, i32* @foo, align 4, !dbg !17
22   ret void, !dbg !18
23 }
24
25 ; Function Attrs: noinline nounwind optnone uwtable
26 define i32 @get() #0 !dbg !19 {
27 entry:
28   %0 = load i32, i32* @foo, align 4, !dbg !22
29   ret i32 %0, !dbg !23
30 }
31
32 attributes #0 = { noinline nounwind optnone uwtable }
33
34 !llvm.dbg.cu = !{!2}
35 !llvm.module.flags = !{!7, !8, !9}
36 !llvm.ident = !{!10}
37
38 !0 = !DIGlobalVariableExpression(var: !1, expr: !DIExpression(DW_OP_LLVM_fragment, 0, 1))
39 !1 = distinct !DIGlobalVariable(name: "foo", scope: !2, file: !3, line: 1, type: !6, isLocal: true, isDefinition: true)
40 !2 = distinct !DICompileUnit(language: DW_LANG_C99, file: !3, producer: "clang version 6.0.0 ", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !4, globals: !5)
41 !3 = !DIFile(filename: "integer-bool-dwarf.c", directory: "/")
42 !4 = !{}
43 !5 = !{!0}
44 !6 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)
45 !7 = !{i32 2, !"Dwarf Version", i32 4}
46 !8 = !{i32 2, !"Debug Info Version", i32 3}
47 !9 = !{i32 1, !"wchar_size", i32 4}
48 !10 = !{!"clang version 6.0.0 "}
49 !11 = distinct !DISubprogram(name: "set1", scope: !3, file: !3, line: 3, type: !12, isLocal: false, isDefinition: true, scopeLine: 4, isOptimized: false, unit: !2, retainedNodes: !4)
50 !12 = !DISubroutineType(types: !13)
51 !13 = !{null}
52 !14 = !DILocation(line: 5, column: 7, scope: !11)
53 !15 = !DILocation(line: 6, column: 1, scope: !11)
54 !16 = distinct !DISubprogram(name: "set2", scope: !3, file: !3, line: 8, type: !12, isLocal: false, isDefinition: true, scopeLine: 9, isOptimized: false, unit: !2, retainedNodes: !4)
55 !17 = !DILocation(line: 10, column: 7, scope: !16)
56 !18 = !DILocation(line: 11, column: 1, scope: !16)
57 !19 = distinct !DISubprogram(name: "get", scope: !3, file: !3, line: 13, type: !20, isLocal: false, isDefinition: true, scopeLine: 14, isOptimized: false, unit: !2, retainedNodes: !4)
58 !20 = !DISubroutineType(types: !21)
59 !21 = !{!6}
60 !22 = !DILocation(line: 15, column: 10, scope: !19)
61 !23 = !DILocation(line: 15, column: 3, scope: !19)