llvm-project/llvm/test/CodeGen/PowerPC/aix-inline-asm-clobber-warning.ll
zhijian lin 2cd32132db
[PowerPC] Utilize getReservedRegs to find asm clobberable registers. (#107863)
This patch utilizes getReservedRegs() to find asm clobberable registers.
And to make the result of getReservedRegs() accurate, this patch
implements the todo, which is to make r2 allocatable on AIX for some
leaf functions.
2024-11-04 12:57:26 -05:00

16 lines
659 B
LLVM

; RUN: llc < %s -mtriple=powerpc-unknown-aix-xcoff -verify-machineinstrs \
; RUN: -mcpu=pwr7 -mattr=+altivec -O0 2>&1 | FileCheck %s
; RUN: llc < %s -mtriple=powerpc64-unknown-aix-xcoff -verify-machineinstrs \
; RUN: -mcpu=pwr7 -mattr=+altivec -O0 2>&1 | FileCheck %s
; CHECK: warning: inline asm clobber list contains reserved registers: R2
; CHECK-NEXT: note: Reserved registers on the clobber list may not be preserved across the asm statement, and clobbering them may lead to undefined behaviour.
@a = external global i32, align 4
define void @bar() {
store i32 0, ptr @a, align 4
call void asm sideeffect "li 2, 1", "~{r2}"()
ret void
}