summaryrefslogtreecommitdiffstats
path: root/llvm/test/Transforms/Attributor/IPConstantProp/2008-06-09-WeakProp.ll
blob: d05e3b113191080748bf613f32a5bf4f03775b4b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
; 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
}

OpenPOWER on IntegriCloud