aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--test/CodeGen/X86/ioport.llx18
1 files changed, 18 insertions, 0 deletions
diff --git a/test/CodeGen/X86/ioport.llx b/test/CodeGen/X86/ioport.llx
new file mode 100644
index 0000000000..37f80d2fb8
--- /dev/null
+++ b/test/CodeGen/X86/ioport.llx
@@ -0,0 +1,18 @@
+; RUN: llvm-as < %s | llc -march=x86
+
+implementation
+
+declare int %llvm.readport (ushort)
+declare void %llvm.writeport (int, ushort)
+
+uint %in (uint %p) {
+ %i1 = call int(ushort)* %llvm.readport (ushort 255)
+ ret uint 5
+}
+
+
+uint %out (uint %p) {
+ call void(int, ushort)* %llvm.writeport (int 1, ushort 255)
+ ret uint 5
+}
+