aboutsummaryrefslogtreecommitdiffstats
path: root/test/CodeGen
diff options
context:
space:
mode:
authorJohn Criswell <criswell@uiuc.edu>2004-04-14 13:52:56 +0000
committerJohn Criswell <criswell@uiuc.edu>2004-04-14 13:52:56 +0000
commit5365b6d143fe5f1463a512ba98be9ce348046de6 (patch)
tree053161de0c4da9b5c89e8ec68aeaa92cb1f1f7d2 /test/CodeGen
parent994a765e5cc28beae12e99fe2c680ad15c951cbd (diff)
downloadexternal_llvm-5365b6d143fe5f1463a512ba98be9ce348046de6.zip
external_llvm-5365b6d143fe5f1463a512ba98be9ce348046de6.tar.gz
external_llvm-5365b6d143fe5f1463a512ba98be9ce348046de6.tar.bz2
Test for memory mapped I/O intrinsics.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12943 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGen')
-rw-r--r--test/CodeGen/X86/io.llx21
1 files changed, 21 insertions, 0 deletions
diff --git a/test/CodeGen/X86/io.llx b/test/CodeGen/X86/io.llx
new file mode 100644
index 0000000..c5b00d5
--- /dev/null
+++ b/test/CodeGen/X86/io.llx
@@ -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
+}
+