mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-15 20:29:48 +00:00
39f4e8d9cc
This update was done with the following bash script: find test/Transforms -name "*.ll" | \ while read NAME; do echo "$NAME" if ! grep -q "^; *RUN: *llc" $NAME; then TEMP=`mktemp -t temp` cp $NAME $TEMP sed -n "s/^define [^@]*@\([A-Za-z0-9_]*\)(.*$/\1/p" < $NAME | \ while read FUNC; do sed -i '' "s/;\(.*\)\([A-Za-z0-9_]*\):\( *\)@$FUNC\([( ]*\)\$/;\1\2-LABEL:\3@$FUNC(/g" $TEMP done mv $TEMP $NAME fi done git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186268 91177308-0d34-0410-b5e6-96231b3b80d8
53 lines
963 B
LLVM
53 lines
963 B
LLVM
; RUN: opt -deadargelim -S < %s | FileCheck %s
|
|
|
|
define void @test(i32) {
|
|
ret void
|
|
}
|
|
|
|
define void @foo() {
|
|
call void @test(i32 0)
|
|
ret void
|
|
; CHECK-LABEL: @foo(
|
|
; CHECK: i32 undef
|
|
}
|
|
|
|
define void @f(i32 %X) {
|
|
entry:
|
|
tail call void @sideeffect() nounwind
|
|
ret void
|
|
}
|
|
|
|
declare void @sideeffect()
|
|
|
|
define void @g(i32 %n) {
|
|
entry:
|
|
%add = add nsw i32 %n, 1
|
|
; CHECK: tail call void @f(i32 undef)
|
|
tail call void @f(i32 %add)
|
|
ret void
|
|
}
|
|
|
|
define void @h() {
|
|
entry:
|
|
%i = alloca i32, align 4
|
|
store volatile i32 10, i32* %i, align 4
|
|
; CHECK: %tmp = load volatile i32* %i, align 4
|
|
; CHECK-next: call void @f(i32 undef)
|
|
%tmp = load volatile i32* %i, align 4
|
|
call void @f(i32 %tmp)
|
|
ret void
|
|
}
|
|
|
|
; Check that callers are not transformed for weak definitions.
|
|
define weak i32 @weak_f(i32 %x) nounwind {
|
|
entry:
|
|
ret i32 0
|
|
}
|
|
define void @weak_f_caller() nounwind {
|
|
entry:
|
|
; CHECK: call i32 @weak_f(i32 10)
|
|
%call = tail call i32 @weak_f(i32 10)
|
|
ret void
|
|
}
|
|
|