Mercurial > hg > CbC > CbC_llvm
comparison test/Linker/replaced-function-matches-first-subprogram.ll @ 95:afa8332a0e37 LLVM3.8
LLVM 3.8
author | Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp> |
---|---|
date | Tue, 13 Oct 2015 17:48:58 +0900 |
parents | 60c9769439b8 |
children | 7d135dc70f03 |
comparison
equal
deleted
inserted
replaced
84:f3e34b893a5f | 95:afa8332a0e37 |
---|---|
27 ; CHECK: !dbg ![[LOC:[0-9]+]] | 27 ; CHECK: !dbg ![[LOC:[0-9]+]] |
28 define linkonce_odr i32 @_ZN5ClassIiE3fooEv(%struct.Class* %this) align 2 { | 28 define linkonce_odr i32 @_ZN5ClassIiE3fooEv(%struct.Class* %this) align 2 { |
29 entry: | 29 entry: |
30 %this.addr = alloca %struct.Class*, align 8 | 30 %this.addr = alloca %struct.Class*, align 8 |
31 store %struct.Class* %this, %struct.Class** %this.addr, align 8 | 31 store %struct.Class* %this, %struct.Class** %this.addr, align 8 |
32 %this1 = load %struct.Class** %this.addr | 32 %this1 = load %struct.Class*, %struct.Class** %this.addr |
33 ret i32 0, !dbg !15 | 33 ret i32 0, !dbg !15 |
34 } | 34 } |
35 | 35 |
36 ; CHECK: !llvm.dbg.cu = !{![[CU1:[0-9]+]], ![[CU2:[0-9]+]]} | 36 ; CHECK: !llvm.dbg.cu = !{![[CU1:[0-9]+]], ![[CU2:[0-9]+]]} |
37 !llvm.dbg.cu = !{!0} | 37 !llvm.dbg.cu = !{!0} |
38 !llvm.module.flags = !{!10, !11, !12} | 38 !llvm.module.flags = !{!10, !11, !12} |
39 !llvm.ident = !{!13} | 39 !llvm.ident = !{!13} |
40 | 40 |
41 ; Extract out the list of subprograms from each compile unit. | 41 ; Extract out the list of subprograms from each compile unit. |
42 ; CHECK-DAG: ![[CU1]] = !{!"0x11{{[^"]+}}", {{[^,]+}}, {{[^,]+}}, {{[^,]+}}, ![[SPs1:[0-9]+]], | 42 ; CHECK-DAG: ![[CU1]] = distinct !DICompileUnit({{.*}} subprograms: ![[SPs1:[0-9]+]] |
43 ; CHECK-DAG: ![[CU2]] = !{!"0x11{{[^"]+}}", {{[^,]+}}, {{[^,]+}}, {{[^,]+}}, ![[SPs2:[0-9]+]], | 43 ; CHECK-DAG: ![[CU2]] = distinct !DICompileUnit({{.*}} subprograms: ![[SPs2:[0-9]+]] |
44 !0 = !{!"0x11\004\00clang version 3.6.0 (trunk 224193) (llvm/trunk 224197)\000\00\000\00\002", !1, !2, !2, !3, !2, !2} ; [ DW_TAG_compile_unit ] [/Users/dexonsmith/data/llvm/staging/test/Linker/repro/d1/t1.cpp] [DW_LANG_C_plus_plus] | 44 !0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.6.0 (trunk 224193) (llvm/trunk 224197)", isOptimized: false, emissionKind: 2, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2) |
45 !1 = !{!"t1.cpp", !"/Users/dexonsmith/data/llvm/staging/test/Linker/repro/d1"} | 45 !1 = !DIFile(filename: "t1.cpp", directory: "/Users/dexonsmith/data/llvm/staging/test/Linker/repro/d1") |
46 !2 = !{} | 46 !2 = !{} |
47 | 47 |
48 ; Extract out each compile unit's single subprogram. The replaced subprogram | 48 ; Extract out each compile unit's single subprogram. The replaced subprogram's |
49 ; should be dropped by the first compile unit. | 49 ; function should drop to null in the first compile unit. |
50 ; CHECK-DAG: ![[SPs1]] = !{![[SP1:[0-9]+]]} | 50 ; CHECK-DAG: ![[SPs1]] = !{![[SP1:[0-9]+]], ![[SP2r:[0-9]+]]} |
51 ; CHECK-DAG: ![[SPs2]] = !{![[SP2:[0-9]+]]} | 51 ; CHECK-DAG: ![[SPs2]] = !{![[SP2:[0-9]+]]} |
52 !3 = !{!4, !7} | 52 !3 = !{!4, !7} |
53 !4 = !{!"0x2e\00foo\00foo\00\002\000\001\000\000\00256\000\002", !1, !5, !6, null, i32 ()* @_Z3foov, null, null, !2} ; [ DW_TAG_subprogram ] [line 2] [def] [foo] | 53 !4 = distinct !DISubprogram(name: "foo", line: 2, isLocal: false, isDefinition: true, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 2, file: !1, scope: !5, type: !6, function: i32 ()* @_Z3foov, variables: !2) |
54 !5 = !{!"0x29", !1} ; [ DW_TAG_file_type ] [/Users/dexonsmith/data/llvm/staging/test/Linker/repro/d1/t1.cpp] | 54 !5 = !DIFile(filename: "t1.cpp", directory: "/Users/dexonsmith/data/llvm/staging/test/Linker/repro/d1") |
55 !6 = !{!"0x15\00\000\000\000\000\000\000", null, null, null, !2, null, null, null} ; [ DW_TAG_subroutine_type ] [line 0, size 0, align 0, offset 0] [from ] | 55 !6 = !DISubroutineType(types: !2) |
56 | 56 |
57 ; Extract out the file from the replaced subprogram. Confirm that each | 57 ; Extract out the file from the replaced subprogram. Confirm that each |
58 ; subprogram is pointing at the correct function. | 58 ; subprogram is pointing at the correct function. |
59 ; CHECK-DAG: ![[SP1]] = !{!"0x2e{{[^"]+}}", {{.*}}, i32 ()* @_Z3foov, | 59 ; CHECK-DAG: ![[SP1]] = distinct !DISubprogram({{.*}} function: i32 ()* @_Z3foov |
60 ; CHECK-DAG: ![[SP2]] = !{!"0x2e{{[^"]+}}", ![[FILE:[0-9]+]], {{.*}}, i32 (%struct.Class*)* @_ZN5ClassIiE3fooEv, | 60 ; CHECK-DAG: ![[SP2]] = distinct !DISubprogram({{.*}} file: ![[FILE:[0-9]+]],{{.*}} function: i32 (%struct.Class*)* @_ZN5ClassIiE3fooEv |
61 !7 = !{!"0x2e\00foo\00foo\00\002\000\001\000\000\00256\000\002", !8, !9, !6, null, i32 (%struct.Class*)* @_ZN5ClassIiE3fooEv, null, null, !2} ; [ DW_TAG_subprogram ] [line 2] [def] [foo] | 61 |
62 ; We can't use CHECK-NOT/CHECK-SAME with a CHECK-DAG, so rely on field order to | |
63 ; prove that there's no function: here. | |
64 ; CHECK-DAG: ![[SP2r]] = {{.*}}!DISubprogram({{.*}} isOptimized: false, variables: | |
65 !7 = distinct !DISubprogram(name: "foo", line: 2, isLocal: false, isDefinition: true, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 2, file: !8, scope: !9, type: !6, function: i32 (%struct.Class*)* @_ZN5ClassIiE3fooEv, variables: !2) | |
62 | 66 |
63 ; The new subprogram should be pointing at the new directory. | 67 ; The new subprogram should be pointing at the new directory. |
64 ; CHECK-DAG: ![[FILE]] = !{!"../t.h", !"/Users/dexonsmith/data/llvm/staging/test/Linker/repro/d2"} | 68 ; CHECK-DAG: ![[FILE]] = !DIFile(filename: "../t.h", directory: "/Users/dexonsmith/data/llvm/staging/test/Linker/repro/d2") |
65 !8 = !{!"../t.h", !"/Users/dexonsmith/data/llvm/staging/test/Linker/repro/d1"} | 69 !8 = !DIFile(filename: "../t.h", directory: "/Users/dexonsmith/data/llvm/staging/test/Linker/repro/d1") |
66 !9 = !{!"0x29", !8} ; [ DW_TAG_file_type ] [/Users/dexonsmith/data/llvm/staging/test/Linker/repro/d1/../t.h] | 70 !9 = !DIFile(filename: "../t.h", directory: "/Users/dexonsmith/data/llvm/staging/test/Linker/repro/d1") |
67 !10 = !{i32 2, !"Dwarf Version", i32 2} | 71 !10 = !{i32 2, !"Dwarf Version", i32 2} |
68 !11 = !{i32 2, !"Debug Info Version", i32 2} | 72 !11 = !{i32 2, !"Debug Info Version", i32 3} |
69 !12 = !{i32 1, !"PIC Level", i32 2} | 73 !12 = !{i32 1, !"PIC Level", i32 2} |
70 !13 = !{!"clang version 3.6.0 (trunk 224193) (llvm/trunk 224197)"} | 74 !13 = !{!"clang version 3.6.0 (trunk 224193) (llvm/trunk 224197)"} |
71 !14 = !MDLocation(line: 2, column: 20, scope: !4) | 75 !14 = !DILocation(line: 2, column: 20, scope: !4) |
72 | 76 |
73 ; The same subprogram should be pointed to by inside the !dbg reference. | 77 ; The same subprogram should be pointed to by inside the !dbg reference. |
74 ; CHECK: ![[LOC]] = !MDLocation(line: 2, column: 15, scope: ![[SP2]]) | 78 ; CHECK: ![[LOC]] = !DILocation(line: 2, column: 15, scope: ![[SP2]]) |
75 !15 = !MDLocation(line: 2, column: 15, scope: !7) | 79 !15 = !DILocation(line: 2, column: 15, scope: !7) |