2013-02-11 08:34:57 +00:00
|
|
|
; RUN: opt < %s -argpromotion -S | FileCheck %s
|
2008-02-01 20:37:16 +00:00
|
|
|
|
2013-02-20 07:21:42 +00:00
|
|
|
; CHECK: define internal i32 @deref(i32 %x.val) #0 {
|
2008-02-01 20:37:16 +00:00
|
|
|
define internal i32 @deref(i32* %x) nounwind {
|
|
|
|
entry:
|
2015-02-27 21:17:42 +00:00
|
|
|
%tmp2 = load i32, i32* %x, align 4
|
2013-02-11 08:34:57 +00:00
|
|
|
ret i32 %tmp2
|
2008-02-01 20:37:16 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
define i32 @f(i32 %x) {
|
|
|
|
entry:
|
2013-02-11 08:34:57 +00:00
|
|
|
%x_addr = alloca i32
|
|
|
|
store i32 %x, i32* %x_addr, align 4
|
2013-02-22 09:09:42 +00:00
|
|
|
; CHECK: %tmp1 = call i32 @deref(i32 %x_addr.val) [[NUW:#[0-9]+]]
|
2013-02-11 08:34:57 +00:00
|
|
|
%tmp1 = call i32 @deref( i32* %x_addr ) nounwind
|
|
|
|
ret i32 %tmp1
|
2008-02-01 20:37:16 +00:00
|
|
|
}
|
2013-02-20 07:21:42 +00:00
|
|
|
|
2013-02-22 09:09:42 +00:00
|
|
|
; CHECK: attributes [[NUW]] = { nounwind }
|