mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-17 03:30:28 +00:00
Testcase for llvm checkin 112674.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112675 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
47b7efc082
commit
a6d050df14
32
test/FrontendC/asm-reg-var-local.c
Normal file
32
test/FrontendC/asm-reg-var-local.c
Normal file
@ -0,0 +1,32 @@
|
||||
// RUN: %llvmgcc %s -m64 -S -o - | FileCheck %s
|
||||
// Exercise various use cases for local asm "register variables".
|
||||
// XFAIL: *
|
||||
// XTARGET: x86_64
|
||||
|
||||
int foo() {
|
||||
// CHECK: %a = alloca i32
|
||||
|
||||
register int a asm("rsi")=5;
|
||||
// CHECK: store i32 5, i32* %a, align 4
|
||||
|
||||
asm volatile("; %0 This asm defines rsi" : "=r"(a));
|
||||
// CHECK: %asmtmp = call i32 asm sideeffect "; $0 This asm defines rsi", "={rsi}
|
||||
// CHECK: store i32 %asmtmp, i32* %a
|
||||
|
||||
a = 42;
|
||||
// CHECK: store i32 42, i32* %a, align 4
|
||||
|
||||
asm volatile("; %0 This asm uses rsi" : : "r"(a));
|
||||
// CHECK: %1 = load i32* %a, align 4
|
||||
// CHECK: call void asm sideeffect "", "{rsi}"(i32 %1) nounwind
|
||||
// CHECK: %2 = call i32 asm sideeffect "", "={rsi}"() nounwind
|
||||
// CHECK: call void asm sideeffect "; $0 This asm uses rsi", "{rsi},~{dirflag},~{fpsr},~{flags}"(i32 %2)
|
||||
|
||||
return a;
|
||||
// CHECK: %3 = load i32* %a, align 4
|
||||
// CHECK: call void asm sideeffect "", "{rsi}"(i32 %3) nounwind
|
||||
// CHECK: %4 = call i32 asm sideeffect "", "={rsi}"() nounwind
|
||||
// CHECK: store i32 %4, i32* %0, align 4
|
||||
// CHECK: %5 = load i32* %0, align 4
|
||||
// CHECK: store i32 %5, i32* %retval, align 4
|
||||
}
|
Loading…
Reference in New Issue
Block a user