2008-06-09-WeakProp.ll
613 Bytes
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --function-signature --scrub-attributes
; RUN: opt < %s -passes=attributor -S | FileCheck %s
; Should not propagate the result of a weak function.
; PR2411
define weak i32 @foo() nounwind {
; CHECK-LABEL: define {{[^@]+}}@foo()
; CHECK-NEXT: entry:
; CHECK-NEXT: ret i32 1
;
entry:
ret i32 1
}
define i32 @main() nounwind {
; CHECK-LABEL: define {{[^@]+}}@main()
; CHECK-NEXT: entry:
; CHECK-NEXT: [[R:%.*]] = call i32 @foo()
; CHECK-NEXT: ret i32 [[R]]
;
entry:
%r = call i32 @foo( ) nounwind
ret i32 %r
}