2014-02-13 10:18:36 +08:00
|
|
|
; RUN: opt < %s -globalopt -S | FileCheck %s
|
2008-09-10 03:04:59 +08:00
|
|
|
|
2015-09-11 11:22:04 +08:00
|
|
|
@foo1 = alias void (), void ()* @foo2
|
|
|
|
; CHECK: @foo1 = alias void (), void ()* @bar2
|
2013-06-13 00:35:53 +08:00
|
|
|
|
2015-09-11 11:22:04 +08:00
|
|
|
@foo2 = alias void(), void()* @bar1
|
|
|
|
; CHECK: @foo2 = alias void (), void ()* @bar2
|
2013-06-13 00:35:53 +08:00
|
|
|
|
2015-09-11 11:22:04 +08:00
|
|
|
@bar1 = alias void (), void ()* @bar2
|
|
|
|
; CHECK: @bar1 = alias void (), void ()* @bar2
|
2008-09-10 03:04:59 +08:00
|
|
|
|
2015-09-11 11:22:04 +08:00
|
|
|
@weak1 = weak alias void (), void ()* @bar2
|
|
|
|
; CHECK: @weak1 = weak alias void (), void ()* @bar2
|
2014-03-27 23:26:56 +08:00
|
|
|
|
2014-07-01 08:30:56 +08:00
|
|
|
@bar4 = private unnamed_addr constant [2 x i8*] zeroinitializer
|
2015-12-23 03:50:22 +08:00
|
|
|
@foo4 = weak_odr unnamed_addr alias i8*, getelementptr inbounds ([2 x i8*], [2 x i8*]* @bar4, i32 0, i32 1)
|
|
|
|
; CHECK: @foo4 = weak_odr unnamed_addr alias i8*, getelementptr inbounds ([2 x i8*], [2 x i8*]* @bar4, i32 0, i32 1)
|
2014-07-01 08:30:56 +08:00
|
|
|
|
2014-03-13 04:15:49 +08:00
|
|
|
define void @bar2() {
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
; CHECK: define void @bar2()
|
2008-09-10 03:04:59 +08:00
|
|
|
|
|
|
|
define void @baz() {
|
|
|
|
entry:
|
2013-06-13 00:35:53 +08:00
|
|
|
call void @foo1()
|
2014-03-27 23:26:56 +08:00
|
|
|
; CHECK: call void @bar2()
|
2013-06-13 00:35:53 +08:00
|
|
|
|
|
|
|
call void @foo2()
|
2014-03-27 23:26:56 +08:00
|
|
|
; CHECK: call void @bar2()
|
2013-06-13 00:35:53 +08:00
|
|
|
|
|
|
|
call void @bar1()
|
|
|
|
; CHECK: call void @bar2()
|
|
|
|
|
2014-03-27 23:26:56 +08:00
|
|
|
call void @weak1()
|
|
|
|
; CHECK: call void @weak1()
|
2013-06-13 00:35:53 +08:00
|
|
|
ret void
|
2008-09-10 03:04:59 +08:00
|
|
|
}
|
2013-06-13 00:45:47 +08:00
|
|
|
|
2015-09-11 11:22:04 +08:00
|
|
|
@foo3 = alias void (), void ()* @bar3
|
2013-06-13 00:45:47 +08:00
|
|
|
; CHECK-NOT: bar3
|
|
|
|
|
|
|
|
define internal void @bar3() {
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
;CHECK: define void @foo3
|