blob: 0820399a30929efd956f750df3c1f1225bc6cd70 [file] [log] [blame]
Reid Spencerc0948362007-01-16 18:08:22 +00001; RUN: llvm-as %s -o - | llvm-dis > %t1.ll
2; RUN: llvm-as %t1.ll -o - | llvm-dis > %t2.ll
3; RUN: diff %t1.ll %t2.ll
4
Reid Spencerc0948362007-01-16 18:08:22 +00005
Reid Spencere3ff5ad2007-01-26 08:25:06 +00006define i31 @"simpleArith"(i31 %i0, i31 %j0)
Reid Spencerc0948362007-01-16 18:08:22 +00007begin
8 %t1 = add i31 %i0, %j0
9 %t2 = sub i31 %i0, %j0
10 %t3 = mul i31 %t1, %t2
11 %t4 = udiv i31 %t1, %t2
12 %t5 = sdiv i31 %t1, %t2
13 %t6 = urem i31 %t1, %t2
14 %t7 = srem i31 %t1, %t2
Reid Spencer832254e2007-02-02 02:16:23 +000015 %t8 = shl i31 %t1, 9
16 %t9 = lshr i31 %t1, 9
17 %t10= ashr i31 %t1, 9
Reid Spencerc0948362007-01-16 18:08:22 +000018 %f1 = sitofp i31 %t1 to float
19 %f2 = fdiv float 4.0, %f1
20 ret i31 %t3
21end