2013-06-12 16:45:47 +00:00
|
|
|
; We use a temporary file so that the test fails when opt crashes.
|
|
|
|
|
|
|
|
; RUN: opt < %s -globalopt -S > %t
|
|
|
|
; RUN: FileCheck %s < %t
|
2008-09-09 19:04:59 +00:00
|
|
|
|
|
|
|
@foo1 = alias void ()* @foo2
|
2013-06-12 16:35:53 +00:00
|
|
|
; CHECK: @foo1 = alias void ()* @foo2
|
|
|
|
|
2008-09-09 19:04:59 +00:00
|
|
|
@foo2 = alias weak void()* @bar1
|
2013-06-12 16:35:53 +00:00
|
|
|
; CHECK: @foo2 = alias weak void ()* @bar2
|
|
|
|
|
2008-09-09 19:04:59 +00:00
|
|
|
@bar1 = alias void ()* @bar2
|
2013-06-12 16:35:53 +00:00
|
|
|
; CHECK: @bar1 = alias void ()* @bar2
|
2008-09-09 19:04:59 +00:00
|
|
|
|
|
|
|
declare void @bar2()
|
2013-06-12 16:35:53 +00:00
|
|
|
; CHECK: declare void @bar2()
|
2008-09-09 19:04:59 +00:00
|
|
|
|
|
|
|
define void @baz() {
|
|
|
|
entry:
|
2013-06-12 16:35:53 +00:00
|
|
|
call void @foo1()
|
|
|
|
; CHECK: call void @foo2()
|
|
|
|
|
|
|
|
call void @foo2()
|
|
|
|
; CHECK: call void @foo2()
|
|
|
|
|
|
|
|
call void @bar1()
|
|
|
|
; CHECK: call void @bar2()
|
|
|
|
|
|
|
|
ret void
|
2008-09-09 19:04:59 +00:00
|
|
|
}
|
2013-06-12 16:45:47 +00:00
|
|
|
|
|
|
|
@foo3 = alias void ()* @bar3
|
|
|
|
; CHECK-NOT: bar3
|
|
|
|
|
|
|
|
define internal void @bar3() {
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
;CHECK: define void @foo3
|