1 ; RUN: opt -passes=globalopt -S -o - < %s | FileCheck %s
3 @glbl = internal global ptr null
5 define void @test1a() {
6 ; CHECK-LABEL: @test1a(
9 store ptr null, ptr @glbl
13 define void @test1b(ptr %p) {
14 ; CHECK-LABEL: @test1b(
16 ; CHECK-NEXT: ret void
17 store ptr %p, ptr @glbl
21 define void @test2() {
22 ; CHECK-LABEL: @test2(
25 call void @foo2(ptr %txt)
26 %call2 = call ptr @strdup(ptr %txt)
27 store ptr %call2, ptr @glbl
30 declare ptr @strdup(ptr)
31 declare void @foo2(ptr)
33 define void @test3() uwtable personality ptr @__gxx_personality_v0 {
34 ; CHECK-LABEL: @test3(
38 %ptr = invoke ptr @_Znwm(i64 1)
39 to label %bb1 unwind label %bb2
41 store ptr %ptr, ptr @glbl
44 %tmp1 = landingpad { ptr, i32 }
46 resume { ptr, i32 } %tmp1
48 declare i32 @__gxx_personality_v0(i32, i64, ptr, ptr)
49 declare ptr @_Znwm(i64)