blob: 014d261c521fa6934e43c2a2e5ecb48a03b6317f [file] [log] [blame]
Dan Gohmanf17a25c2007-07-18 16:29:46 +00001; Make sure this testcase is supported by all code generators
2; RUN: llvm-upgrade < %s | llvm-as | llc
3
4declare ulong %llvm.ctpop.i64(ulong)
5declare uint %llvm.ctpop.i32(uint)
6declare ushort %llvm.ctpop.i16(ushort)
7declare ubyte %llvm.ctpop.i8(ubyte)
8
9void %ctpoptest(ubyte %A, ushort %B, uint %C, ulong %D,
10 ubyte *%AP, ushort* %BP, uint* %CP, ulong* %DP) {
11 %a = call ubyte %llvm.ctpop.i8(ubyte %A)
12 %b = call ushort %llvm.ctpop.i16(ushort %B)
13 %c = call uint %llvm.ctpop.i32(uint %C)
14 %d = call ulong %llvm.ctpop.i64(ulong %D)
15
16 store ubyte %a, ubyte* %AP
17 store ushort %b, ushort* %BP
18 store uint %c, uint* %CP
19 store ulong %d, ulong* %DP
20 ret void
21}
22
23declare ulong %llvm.ctlz.i64(ulong)
24declare uint %llvm.ctlz.i32(uint)
25declare ushort %llvm.ctlz.i16(ushort)
26declare ubyte %llvm.ctlz.i8(ubyte)
27
28void %ctlztest(ubyte %A, ushort %B, uint %C, ulong %D,
29 ubyte *%AP, ushort* %BP, uint* %CP, ulong* %DP) {
30 %a = call ubyte %llvm.ctlz.i8(ubyte %A)
31 %b = call ushort %llvm.ctlz.i16(ushort %B)
32 %c = call uint %llvm.ctlz.i32(uint %C)
33 %d = call ulong %llvm.ctlz.i64(ulong %D)
34
35 store ubyte %a, ubyte* %AP
36 store ushort %b, ushort* %BP
37 store uint %c, uint* %CP
38 store ulong %d, ulong* %DP
39 ret void
40}
41
42declare ulong %llvm.cttz.i64(ulong)
43declare uint %llvm.cttz.i32(uint)
44declare ushort %llvm.cttz.i16(ushort)
45declare ubyte %llvm.cttz.i8(ubyte)
46
47void %cttztest(ubyte %A, ushort %B, uint %C, ulong %D,
48 ubyte *%AP, ushort* %BP, uint* %CP, ulong* %DP) {
49 %a = call ubyte %llvm.cttz.i8(ubyte %A)
50 %b = call ushort %llvm.cttz.i16(ushort %B)
51 %c = call uint %llvm.cttz.i32(uint %C)
52 %d = call ulong %llvm.cttz.i64(ulong %D)
53
54 store ubyte %a, ubyte* %AP
55 store ushort %b, ushort* %BP
56 store uint %c, uint* %CP
57 store ulong %d, ulong* %DP
58 ret void
59}