Chris Lattner | 3c8a3b1 | 2005-05-11 04:22:47 +0000 | [diff] [blame] | 1 | ; Make sure this testcase is supported by all code generators |
Reid Spencer | 69ccadd | 2006-12-02 04:23:10 +0000 | [diff] [blame] | 2 | ; RUN: llvm-upgrade < %s | llvm-as | llc |
Chris Lattner | 3c8a3b1 | 2005-05-11 04:22:47 +0000 | [diff] [blame] | 3 | |
Reid Spencer | 86189a4 | 2007-04-02 00:51:15 +0000 | [diff] [blame] | 4 | declare ulong %llvm.ctpop.i64(ulong) |
Reid Spencer | d05b67d | 2006-12-02 20:38:10 +0000 | [diff] [blame] | 5 | declare uint %llvm.ctpop.i32(uint) |
Reid Spencer | 86189a4 | 2007-04-02 00:51:15 +0000 | [diff] [blame] | 6 | declare ushort %llvm.ctpop.i16(ushort) |
| 7 | declare ubyte %llvm.ctpop.i8(ubyte) |
Chris Lattner | 3c8a3b1 | 2005-05-11 04:22:47 +0000 | [diff] [blame] | 8 | |
Reid Spencer | d05b67d | 2006-12-02 20:38:10 +0000 | [diff] [blame] | 9 | void %ctpoptest(ubyte %A, ushort %B, uint %C, ulong %D, |
Reid Spencer | 86189a4 | 2007-04-02 00:51:15 +0000 | [diff] [blame] | 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) |
Reid Spencer | d05b67d | 2006-12-02 20:38:10 +0000 | [diff] [blame] | 13 | %c = call uint %llvm.ctpop.i32(uint %C) |
Reid Spencer | 86189a4 | 2007-04-02 00:51:15 +0000 | [diff] [blame] | 14 | %d = call ulong %llvm.ctpop.i64(ulong %D) |
Chris Lattner | 3c8a3b1 | 2005-05-11 04:22:47 +0000 | [diff] [blame] | 15 | |
Reid Spencer | 86189a4 | 2007-04-02 00:51:15 +0000 | [diff] [blame] | 16 | store ubyte %a, ubyte* %AP |
| 17 | store ushort %b, ushort* %BP |
| 18 | store uint %c, uint* %CP |
| 19 | store ulong %d, ulong* %DP |
Chris Lattner | 3c8a3b1 | 2005-05-11 04:22:47 +0000 | [diff] [blame] | 20 | ret void |
| 21 | } |
Chris Lattner | 07fc173 | 2005-05-11 05:31:01 +0000 | [diff] [blame] | 22 | |
Reid Spencer | 86189a4 | 2007-04-02 00:51:15 +0000 | [diff] [blame] | 23 | declare ulong %llvm.ctlz.i64(ulong) |
Reid Spencer | d05b67d | 2006-12-02 20:38:10 +0000 | [diff] [blame] | 24 | declare uint %llvm.ctlz.i32(uint) |
Reid Spencer | 86189a4 | 2007-04-02 00:51:15 +0000 | [diff] [blame] | 25 | declare ushort %llvm.ctlz.i16(ushort) |
| 26 | declare ubyte %llvm.ctlz.i8(ubyte) |
Chris Lattner | 07fc173 | 2005-05-11 05:31:01 +0000 | [diff] [blame] | 27 | |
Reid Spencer | d05b67d | 2006-12-02 20:38:10 +0000 | [diff] [blame] | 28 | void %ctlztest(ubyte %A, ushort %B, uint %C, ulong %D, |
Reid Spencer | 86189a4 | 2007-04-02 00:51:15 +0000 | [diff] [blame] | 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) |
Reid Spencer | d05b67d | 2006-12-02 20:38:10 +0000 | [diff] [blame] | 32 | %c = call uint %llvm.ctlz.i32(uint %C) |
Reid Spencer | 86189a4 | 2007-04-02 00:51:15 +0000 | [diff] [blame] | 33 | %d = call ulong %llvm.ctlz.i64(ulong %D) |
Chris Lattner | 07fc173 | 2005-05-11 05:31:01 +0000 | [diff] [blame] | 34 | |
Reid Spencer | 86189a4 | 2007-04-02 00:51:15 +0000 | [diff] [blame] | 35 | store ubyte %a, ubyte* %AP |
| 36 | store ushort %b, ushort* %BP |
| 37 | store uint %c, uint* %CP |
| 38 | store ulong %d, ulong* %DP |
Chris Lattner | 07fc173 | 2005-05-11 05:31:01 +0000 | [diff] [blame] | 39 | ret void |
| 40 | } |
| 41 | |
Reid Spencer | 86189a4 | 2007-04-02 00:51:15 +0000 | [diff] [blame] | 42 | declare ulong %llvm.cttz.i64(ulong) |
Reid Spencer | d05b67d | 2006-12-02 20:38:10 +0000 | [diff] [blame] | 43 | declare uint %llvm.cttz.i32(uint) |
Reid Spencer | 86189a4 | 2007-04-02 00:51:15 +0000 | [diff] [blame] | 44 | declare ushort %llvm.cttz.i16(ushort) |
| 45 | declare ubyte %llvm.cttz.i8(ubyte) |
Chris Lattner | 07fc173 | 2005-05-11 05:31:01 +0000 | [diff] [blame] | 46 | |
Reid Spencer | d05b67d | 2006-12-02 20:38:10 +0000 | [diff] [blame] | 47 | void %cttztest(ubyte %A, ushort %B, uint %C, ulong %D, |
Reid Spencer | 86189a4 | 2007-04-02 00:51:15 +0000 | [diff] [blame] | 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) |
Reid Spencer | d05b67d | 2006-12-02 20:38:10 +0000 | [diff] [blame] | 51 | %c = call uint %llvm.cttz.i32(uint %C) |
Reid Spencer | 86189a4 | 2007-04-02 00:51:15 +0000 | [diff] [blame] | 52 | %d = call ulong %llvm.cttz.i64(ulong %D) |
Chris Lattner | 07fc173 | 2005-05-11 05:31:01 +0000 | [diff] [blame] | 53 | |
Reid Spencer | 86189a4 | 2007-04-02 00:51:15 +0000 | [diff] [blame] | 54 | store ubyte %a, ubyte* %AP |
| 55 | store ushort %b, ushort* %BP |
| 56 | store uint %c, uint* %CP |
| 57 | store ulong %d, ulong* %DP |
Chris Lattner | 07fc173 | 2005-05-11 05:31:01 +0000 | [diff] [blame] | 58 | ret void |
| 59 | } |