mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-26 23:32:58 +00:00
Test for memory mapped I/O intrinsics.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12943 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
994a765e5c
commit
5365b6d143
21
test/CodeGen/X86/io.llx
Normal file
21
test/CodeGen/X86/io.llx
Normal file
@ -0,0 +1,21 @@
|
||||
; RUN: llvm-as < %s | llc -march=x86
|
||||
|
||||
implementation
|
||||
|
||||
declare int %llvm.readio (int *)
|
||||
declare void %llvm.writeio (int, int *)
|
||||
|
||||
int %in(int * %p1) {
|
||||
%p2 = alloca int
|
||||
%i1 = call int %llvm.readio (int* %p1)
|
||||
%i2 = call int %llvm.readio (int* %p2)
|
||||
%r = add int %i1, %i2
|
||||
ret int %r
|
||||
}
|
||||
|
||||
|
||||
void %out(int* %p) {
|
||||
call void(int, int*)* %llvm.writeio (int 1, int * %p)
|
||||
ret void
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user