mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-09-01 19:29:22 +00:00
attribute themselve. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@146851 91177308-0d34-0410-b5e6-96231b3b80d8
42 lines
804 B
LLVM
42 lines
804 B
LLVM
; RUN: opt < %s -inline -S | FileCheck %s
|
|
|
|
; Check that functions with "returns_twice" calls are only inlined,
|
|
; if they are themselve marked as such.
|
|
|
|
declare i32 @a() returns_twice
|
|
declare i32 @b() returns_twice
|
|
|
|
define i32 @f() {
|
|
entry:
|
|
%call = call i32 @a() returns_twice
|
|
%add = add nsw i32 1, %call
|
|
ret i32 %add
|
|
}
|
|
|
|
define i32 @g() {
|
|
entry:
|
|
; CHECK: define i32 @g
|
|
; CHECK: call i32 @f()
|
|
; CHECK-NOT: call i32 @a()
|
|
%call = call i32 @f()
|
|
%add = add nsw i32 1, %call
|
|
ret i32 %add
|
|
}
|
|
|
|
define i32 @h() returns_twice {
|
|
entry:
|
|
%call = call i32 @b() returns_twice
|
|
%add = add nsw i32 1, %call
|
|
ret i32 %add
|
|
}
|
|
|
|
define i32 @i() {
|
|
entry:
|
|
; CHECK: define i32 @i
|
|
; CHECK: call i32 @b()
|
|
; CHECK-NOT: call i32 @h()
|
|
%call = call i32 @h() returns_twice
|
|
%add = add nsw i32 1, %call
|
|
ret i32 %add
|
|
}
|