blob: d46472673cf169ecd4d2ae876a49c5ed53a142a7 [file] [log] [blame]
Dan Gohmanf17a25c2007-07-18 16:29:46 +00001; RUN: llvm-upgrade < %s | llvm-as | llvm-dis > %t1.ll
2; RUN: llvm-as %t1.ll -o - | llvm-dis > %t2.ll
3; RUN: diff %t1.ll %t2.ll
4
5
6declare bool %llvm.isunordered.f32(float,float)
7declare bool %llvm.isunordered.f64(double,double)
8
9declare void %llvm.prefetch(sbyte*, uint, uint)
10
11declare uint %llvm.ctpop.i8(ubyte)
12declare uint %llvm.ctpop.i16(ushort)
13declare uint %llvm.ctpop.i32(uint)
14declare uint %llvm.ctpop.i64(ulong)
15
16declare uint %llvm.cttz.i8(ubyte)
17declare uint %llvm.cttz.i16(ushort)
18declare uint %llvm.cttz.i32(uint)
19declare uint %llvm.cttz.i64(ulong)
20
21declare uint %llvm.ctlz.i8(ubyte)
22declare uint %llvm.ctlz.i16(ushort)
23declare uint %llvm.ctlz.i32(uint)
24declare uint %llvm.ctlz.i64(ulong)
25
26declare float %llvm.sqrt.f32(float)
27declare double %llvm.sqrt.f64(double)
28
29implementation
30
31; Test llvm intrinsics
32;
33void %libm() {
34 call bool %llvm.isunordered.f32(float 1.0, float 2.0)
35 call bool %llvm.isunordered.f64(double 3.0, double 4.0)
36
37 call void %llvm.prefetch(sbyte* null, uint 1, uint 3)
38
39 call float %llvm.sqrt.f32(float 5.0)
40 call double %llvm.sqrt.f64(double 6.0)
41
42 call uint %llvm.ctpop.i8(ubyte 10)
43 call uint %llvm.ctpop.i16(ushort 11)
44 call uint %llvm.ctpop.i32(uint 12)
45 call uint %llvm.ctpop.i64(ulong 13)
46
47 call uint %llvm.ctlz.i8(ubyte 14)
48 call uint %llvm.ctlz.i16(ushort 15)
49 call uint %llvm.ctlz.i32(uint 16)
50 call uint %llvm.ctlz.i64(ulong 17)
51
52 call uint %llvm.cttz.i8(ubyte 18)
53 call uint %llvm.cttz.i16(ushort 19)
54 call uint %llvm.cttz.i32(uint 20)
55 call uint %llvm.cttz.i64(ulong 21)
56 ret void
57}
58
59; FIXME: test ALL the intrinsics in this file.