llvm-6502/test/CodeGen/X86/ioport.llx
Chris Lattner 5deaa7a73d Make the testcase more challenging
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12892 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-13 17:18:07 +00:00

22 lines
445 B
Plaintext

; RUN: llvm-as < %s | llc -march=x86
implementation
declare int %llvm.readport (ushort)
declare void %llvm.writeport (int, ushort)
int %in(ushort %p) {
%i1 = call int %llvm.readport (ushort 255)
%i2 = call int %llvm.readport (ushort %p)
%r = add int %i1, %i2
ret int %r
}
void %out(ushort %p) {
call void(int, ushort)* %llvm.writeport (int 1, ushort 255)
call void(int, ushort)* %llvm.writeport (int 4, ushort %p)
ret void
}