aboutsummaryrefslogtreecommitdiffstats
path: root/test/CodeGen/X86/io.llx
blob: c5b00d5ec66a29f6ce46e1824c7afcab757624ec (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
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
}