2008-02-14 06:56:27 +00:00
|
|
|
; RUN: llvm-as < %s | opt -anders-aa -load-vn -gcse -deadargelim | llvm-dis | grep store | not grep null
|
2004-05-23 21:31:00 +00:00
|
|
|
|
|
|
|
; Because the 'internal' function is passed to an external function, we don't
|
|
|
|
; know what the incoming values will alias. As such, we cannot do the
|
2008-05-23 21:15:35 +00:00
|
|
|
; optimization checked by the 'arg-must-alias.ll' test.
|
2004-05-23 21:31:00 +00:00
|
|
|
|
2008-02-14 06:56:27 +00:00
|
|
|
declare void @external(i32(i32*)*)
|
|
|
|
@G = internal constant i32* null
|
2004-05-23 21:31:00 +00:00
|
|
|
|
2008-02-14 06:56:27 +00:00
|
|
|
define internal i32 @internal(i32* %ARG) {
|
2004-05-23 21:31:00 +00:00
|
|
|
;;; We *DON'T* know that ARG always points to null!
|
2008-02-14 06:56:27 +00:00
|
|
|
store i32* %ARG, i32** @G
|
|
|
|
ret i32 0
|
2004-05-23 21:31:00 +00:00
|
|
|
}
|
|
|
|
|
2008-02-14 06:56:27 +00:00
|
|
|
define i32 @foo() {
|
|
|
|
call void @external(i32(i32*)* @internal)
|
|
|
|
%V = call i32 @internal(i32* null)
|
|
|
|
ret i32 %V
|
2004-05-23 21:31:00 +00:00
|
|
|
}
|