comparison test/Linker/replaced-function-matches-first-subprogram.ll @ 100:7d135dc70f03 LLVM 3.9

LLVM 3.9
author Miyagi Mitsuki <e135756@ie.u-ryukyu.ac.jp>
date Tue, 26 Jan 2016 22:53:40 +0900
parents afa8332a0e37
children 1172e4bd9c6f
comparison
equal deleted inserted replaced
96:6418606d0ead 100:7d135dc70f03
13 ; #include "t.h" 13 ; #include "t.h"
14 ; template struct Class<int>; 14 ; template struct Class<int>;
15 15
16 %struct.Class = type { i8 } 16 %struct.Class = type { i8 }
17 17
18 define i32 @_Z3foov() { 18 ; CHECK: define i32 @_Z3foov(){{.*}} !dbg ![[SP1:[0-9]+]]
19 define i32 @_Z3foov() !dbg !4 {
19 entry: 20 entry:
20 %tmp = alloca %struct.Class, align 1 21 %tmp = alloca %struct.Class, align 1
21 %call = call i32 @_ZN5ClassIiE3fooEv(%struct.Class* %tmp), !dbg !14 22 %call = call i32 @_ZN5ClassIiE3fooEv(%struct.Class* %tmp), !dbg !14
22 ret i32 %call, !dbg !14 23 ret i32 %call, !dbg !14
23 } 24 }
24 25
25 ; CHECK: define weak_odr i32 @_ZN5ClassIiE3fooEv(%struct.Class* %this){{.*}}{ 26 ; CHECK: define weak_odr i32 @_ZN5ClassIiE3fooEv(%struct.Class* %this){{.*}} !dbg ![[SP2:[0-9]+]] {
26 ; CHECK-NOT: } 27 ; CHECK-NOT: }
27 ; CHECK: !dbg ![[LOC:[0-9]+]] 28 ; CHECK: !dbg ![[LOC:[0-9]+]]
28 define linkonce_odr i32 @_ZN5ClassIiE3fooEv(%struct.Class* %this) align 2 { 29 define linkonce_odr i32 @_ZN5ClassIiE3fooEv(%struct.Class* %this) align 2 !dbg !7 {
29 entry: 30 entry:
30 %this.addr = alloca %struct.Class*, align 8 31 %this.addr = alloca %struct.Class*, align 8
31 store %struct.Class* %this, %struct.Class** %this.addr, align 8 32 store %struct.Class* %this, %struct.Class** %this.addr, align 8
32 %this1 = load %struct.Class*, %struct.Class** %this.addr 33 %this1 = load %struct.Class*, %struct.Class** %this.addr
33 ret i32 0, !dbg !15 34 ret i32 0, !dbg !15
45 !1 = !DIFile(filename: "t1.cpp", directory: "/Users/dexonsmith/data/llvm/staging/test/Linker/repro/d1") 46 !1 = !DIFile(filename: "t1.cpp", directory: "/Users/dexonsmith/data/llvm/staging/test/Linker/repro/d1")
46 !2 = !{} 47 !2 = !{}
47 48
48 ; Extract out each compile unit's single subprogram. The replaced subprogram's 49 ; Extract out each compile unit's single subprogram. The replaced subprogram's
49 ; function should drop to null in the first compile unit. 50 ; function should drop to null in the first compile unit.
50 ; CHECK-DAG: ![[SPs1]] = !{![[SP1:[0-9]+]], ![[SP2r:[0-9]+]]} 51 ; CHECK-DAG: ![[SPs1]] = !{![[SP1]], ![[SP2r:[0-9]+]]}
51 ; CHECK-DAG: ![[SPs2]] = !{![[SP2:[0-9]+]]} 52 ; CHECK-DAG: ![[SPs2]] = !{![[SP2]]}
52 !3 = !{!4, !7} 53 !3 = !{!4, !7}
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 !4 = distinct !DISubprogram(name: "foo", line: 2, isLocal: false, isDefinition: true, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 2, file: !1, scope: !5, type: !6, variables: !2)
54 !5 = !DIFile(filename: "t1.cpp", directory: "/Users/dexonsmith/data/llvm/staging/test/Linker/repro/d1") 55 !5 = !DIFile(filename: "t1.cpp", directory: "/Users/dexonsmith/data/llvm/staging/test/Linker/repro/d1")
55 !6 = !DISubroutineType(types: !2) 56 !6 = !DISubroutineType(types: !2)
56 57
57 ; Extract out the file from the replaced subprogram. Confirm that each 58 ; Extract out the file from the replaced subprogram.
58 ; subprogram is pointing at the correct function. 59 ; CHECK-DAG: ![[SP2]] = distinct !DISubprogram({{.*}} file: ![[FILE:[0-9]+]],
59 ; CHECK-DAG: ![[SP1]] = distinct !DISubprogram({{.*}} function: i32 ()* @_Z3foov
60 ; CHECK-DAG: ![[SP2]] = distinct !DISubprogram({{.*}} file: ![[FILE:[0-9]+]],{{.*}} function: i32 (%struct.Class*)* @_ZN5ClassIiE3fooEv
61 60
62 ; We can't use CHECK-NOT/CHECK-SAME with a CHECK-DAG, so rely on field order to 61 ; 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. 62 ; prove that there's no function: here.
64 ; CHECK-DAG: ![[SP2r]] = {{.*}}!DISubprogram({{.*}} isOptimized: false, variables: 63 ; 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) 64 !7 = distinct !DISubprogram(name: "foo", line: 2, isLocal: false, isDefinition: true, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 2, file: !8, scope: !9, type: !6, variables: !2)
66 65
67 ; The new subprogram should be pointing at the new directory. 66 ; The new subprogram should be pointing at the new directory.
68 ; CHECK-DAG: ![[FILE]] = !DIFile(filename: "../t.h", directory: "/Users/dexonsmith/data/llvm/staging/test/Linker/repro/d2") 67 ; CHECK-DAG: ![[FILE]] = !DIFile(filename: "../t.h", directory: "/Users/dexonsmith/data/llvm/staging/test/Linker/repro/d2")
69 !8 = !DIFile(filename: "../t.h", directory: "/Users/dexonsmith/data/llvm/staging/test/Linker/repro/d1") 68 !8 = !DIFile(filename: "../t.h", directory: "/Users/dexonsmith/data/llvm/staging/test/Linker/repro/d1")
70 !9 = !DIFile(filename: "../t.h", directory: "/Users/dexonsmith/data/llvm/staging/test/Linker/repro/d1") 69 !9 = !DIFile(filename: "../t.h", directory: "/Users/dexonsmith/data/llvm/staging/test/Linker/repro/d1")