]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - opencl/llvm.git/blob - test/DebugInfo/X86/cu-ranges-odr.ll
Updates to sync with changes in upstream.
[opencl/llvm.git] / test / DebugInfo / X86 / cu-ranges-odr.ll
1 ; RUN: llc -split-dwarf=Enable -O0 %s -mtriple=x86_64-unknown-linux-gnu -filetype=obj -o %t
2 ; RUN: llvm-dwarfdump -debug-dump=all %t | FileCheck %s
3 ; RUN: llvm-readobj --relocations %t | FileCheck --check-prefix=CHECK-RELOCS %s
5 ; From:
6 ; class A {
7 ; public:
8 ;   A(int i = 0) : a(i) {}
9 ; private:
10 ;   int a;
11 ; };
12 ;
13 ; A a;
15 ; With function sections enabled make sure that we have a DW_AT_ranges attribute.
16 ; CHECK: DW_AT_ranges
18 ; Check that we have a relocation against the .debug_ranges section.
19 ; CHECK-RELOCS: R_X86_64_32 .debug_ranges 0x0
21 %class.A = type { i32 }
23 @a = global %class.A zeroinitializer, align 4
24 @llvm.global_ctors = appending global [1 x { i32, void ()* }] [{ i32, void ()* } { i32 65535, void ()* @_GLOBAL__I_a }]
26 define internal void @__cxx_global_var_init() section ".text.startup" {
27 entry:
28   call void @_ZN1AC2Ei(%class.A* @a, i32 0), !dbg !26
29   ret void, !dbg !26
30 }
32 ; Function Attrs: nounwind uwtable
33 define linkonce_odr void @_ZN1AC2Ei(%class.A* %this, i32 %i) unnamed_addr #0 align 2 {
34 entry:
35   %this.addr = alloca %class.A*, align 8
36   %i.addr = alloca i32, align 4
37   store %class.A* %this, %class.A** %this.addr, align 8
38   call void @llvm.dbg.declare(metadata %class.A** %this.addr, metadata !27, metadata !{!"0x102"}), !dbg !29
39   store i32 %i, i32* %i.addr, align 4
40   call void @llvm.dbg.declare(metadata i32* %i.addr, metadata !30, metadata !{!"0x102"}), !dbg !31
41   %this1 = load %class.A** %this.addr
42   %a = getelementptr inbounds %class.A* %this1, i32 0, i32 0, !dbg !31
43   %0 = load i32* %i.addr, align 4, !dbg !31
44   store i32 %0, i32* %a, align 4, !dbg !31
45   ret void, !dbg !31
46 }
48 ; Function Attrs: nounwind readnone
49 declare void @llvm.dbg.declare(metadata, metadata, metadata) #1
51 define internal void @_GLOBAL__I_a() section ".text.startup" {
52 entry:
53   call void @__cxx_global_var_init(), !dbg !32
54   ret void, !dbg !32
55 }
57 attributes #0 = { nounwind uwtable "less-precise-fpmad"="false" "no-frame-pointer-elim"="true" "no-frame-pointer-elim-non-leaf" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="false" }
58 attributes #1 = { nounwind readnone }
60 !llvm.dbg.cu = !{!0}
61 !llvm.module.flags = !{!23, !24}
62 !llvm.ident = !{!25}
64 !0 = !{!"0x11\004\00clang version 3.5 (trunk 199923) (llvm/trunk 199940)\000\00\000\00\001", !1, !2, !3, !13, !21, !2} ; [ DW_TAG_compile_unit ] [/usr/local/google/home/echristo/tmp/baz.cpp] [DW_LANG_C_plus_plus]
65 !1 = !{!"baz.cpp", !"/usr/local/google/home/echristo/tmp"}
66 !2 = !{}
67 !3 = !{!4}
68 !4 = !{!"0x2\00A\001\0032\0032\000\000\000", !1, null, null, !5, null, null, !"_ZTS1A"} ; [ DW_TAG_class_type ] [A] [line 1, size 32, align 32, offset 0] [def] [from ]
69 !5 = !{!6, !8}
70 !6 = !{!"0xd\00a\005\0032\0032\000\001", !1, !"_ZTS1A", !7} ; [ DW_TAG_member ] [a] [line 5, size 32, align 32, offset 0] [private] [from int]
71 !7 = !{!"0x24\00int\000\0032\0032\000\000\005", null, null} ; [ DW_TAG_base_type ] [int] [line 0, size 32, align 32, offset 0, enc DW_ATE_signed]
72 !8 = !{!"0x2e\00A\00A\00\003\000\000\000\006\00256\000\003", !1, !"_ZTS1A", !9, null, null, null, i32 0, !12} ; [ DW_TAG_subprogram ] [line 3] [A]
73 !9 = !{!"0x15\00\000\000\000\000\000\000", i32 0, null, null, !10, null, null, null} ; [ DW_TAG_subroutine_type ] [line 0, size 0, align 0, offset 0] [from ]
74 !10 = !{null, !11, !7}
75 !11 = !{!"0xf\00\000\0064\0064\000\001088", null, null, !"_ZTS1A"} ; [ DW_TAG_pointer_type ] [line 0, size 64, align 64, offset 0] [artificial] [from _ZTS1A]
76 !12 = !{i32 786468}
77 !13 = !{!14, !18, !19}
78 !14 = !{!"0x2e\00__cxx_global_var_init\00__cxx_global_var_init\00\008\001\001\000\006\00256\000\008", !1, !15, !16, null, void ()* @__cxx_global_var_init, null, null, !2} ; [ DW_TAG_subprogram ] [line 8] [local] [def] [__cxx_global_var_init]
79 !15 = !{!"0x29", !1}         ; [ DW_TAG_file_type ] [/usr/local/google/home/echristo/tmp/baz.cpp]
80 !16 = !{!"0x15\00\000\000\000\000\000\000", i32 0, null, null, !17, null, null, null} ; [ DW_TAG_subroutine_type ] [line 0, size 0, align 0, offset 0] [from ]
81 !17 = !{null}
82 !18 = !{!"0x2e\00A\00A\00_ZN1AC2Ei\003\000\001\000\006\00256\000\003", !1, !"_ZTS1A", !9, null, void (%class.A*, i32)* @_ZN1AC2Ei, null, !8, !2} ; [ DW_TAG_subprogram ] [line 3] [def] [A]
83 !19 = !{!"0x2e\00\00\00_GLOBAL__I_a\003\001\001\000\006\0064\000\003", !1, !15, !20, null, void ()* @_GLOBAL__I_a, null, null, !2} ; [ DW_TAG_subprogram ] [line 3] [local] [def]
84 !20 = !{!"0x15\00\000\000\000\000\000\000", i32 0, null, null, !2, null, null, null} ; [ DW_TAG_subroutine_type ] [line 0, size 0, align 0, offset 0] [from ]
85 !21 = !{!22}
86 !22 = !{!"0x34\00a\00a\00\008\000\001", null, !15, !4, %class.A* @a, null} ; [ DW_TAG_variable ] [a] [line 8] [def]
87 !23 = !{i32 2, !"Dwarf Version", i32 4}
88 !24 = !{i32 1, !"Debug Info Version", i32 2}
89 !25 = !{!"clang version 3.5 (trunk 199923) (llvm/trunk 199940)"}
90 !26 = !MDLocation(line: 8, scope: !14)
91 !27 = !{!"0x101\00this\0016777216\001088", !18, null, !28} ; [ DW_TAG_arg_variable ] [this] [line 0]
92 !28 = !{!"0xf\00\000\0064\0064\000\000", null, null, !"_ZTS1A"} ; [ DW_TAG_pointer_type ] [line 0, size 64, align 64, offset 0] [from _ZTS1A]
93 !29 = !MDLocation(line: 0, scope: !18)
94 !30 = !{!"0x101\00i\0033554435\000", !18, !15, !7} ; [ DW_TAG_arg_variable ] [i] [line 3]
95 !31 = !MDLocation(line: 3, scope: !18)
96 !32 = !MDLocation(line: 3, scope: !19)