blob: f4ba60eb6196422feb53e718448dd38ba043250c [file] [log] [blame]
Amaury Sechete8ea7d82016-02-04 23:26:19 +00001; RUN: llvm-as < %s | llvm-dis > %t.orig
2; RUN: llvm-as < %s | llvm-c-test --echo > %t.echo
3; RUN: diff %t.orig %t.echo
4
5declare void @decl()
6
7; TODO: label, struct and metadata types
8define void @types() {
9 %1 = alloca half
10 %2 = alloca float
11 %3 = alloca double
12 %4 = alloca x86_fp80
13 %5 = alloca fp128
14 %6 = alloca ppc_fp128
15 %7 = alloca i7
16 %8 = alloca void (i1)*
17 %9 = alloca [3 x i22]
18 %10 = alloca i328 addrspace(5)*
19 %11 = alloca <5 x i23*>
20 %12 = alloca x86_mmx
21 ret void
22}
23
Amaury Sechetb6df4352016-02-05 01:27:11 +000024define i32 @iops(i32 %a, i32 %b) {
Amaury Sechete8ea7d82016-02-04 23:26:19 +000025 %1 = add i32 %a, %b
Amaury Sechetb6df4352016-02-05 01:27:11 +000026 %2 = mul i32 %a, %1
27 %3 = sub i32 %2, %1
28 %4 = udiv i32 %3, %b
29 %5 = sdiv i32 %2, %4
30 %6 = urem i32 %3, %5
31 %7 = srem i32 %2, %6
32 %8 = shl i32 %1, %b
33 %9 = lshr i32 %a, %7
34 %10 = ashr i32 %b, %8
35 %11 = and i32 %9, %10
36 %12 = or i32 %2, %11
37 %13 = xor i32 %12, %4
38 ret i32 %13
Amaury Sechete8ea7d82016-02-04 23:26:19 +000039}
40
41define i32 @call() {
Amaury Sechetb6df4352016-02-05 01:27:11 +000042 %1 = call i32 @iops(i32 23, i32 19)
Amaury Sechete8ea7d82016-02-04 23:26:19 +000043 ret i32 %1
44}