2006-12-03 16:17:19 +00:00
|
|
|
; RUN: llvm-upgrade %s | llvm-as -f -o %t.bc
|
2004-11-06 23:32:43 +00:00
|
|
|
; RUN: lli %t.bc > /dev/null
|
|
|
|
|
2002-10-31 23:05:22 +00:00
|
|
|
; test shifts
|
2002-12-13 05:44:21 +00:00
|
|
|
int %main() {
|
2003-01-13 00:57:49 +00:00
|
|
|
%shamt = add ubyte 0, 1
|
|
|
|
|
|
|
|
; Left shifts...
|
2006-12-31 06:02:00 +00:00
|
|
|
%t1.s = shl int 1, ubyte %shamt
|
|
|
|
%t2.s = shl int 1, ubyte 4
|
2003-01-13 00:57:49 +00:00
|
|
|
|
|
|
|
%t1 = shl uint 1, ubyte %shamt
|
|
|
|
%t2 = shl uint 1, ubyte 5
|
|
|
|
|
|
|
|
;%t1 = shl long 1, ubyte %shamt
|
2006-12-31 06:02:00 +00:00
|
|
|
%t2.s = shl long 1, ubyte 4
|
2003-01-13 00:57:49 +00:00
|
|
|
|
|
|
|
;%t1 = shl ulong 1, ubyte %shamt
|
|
|
|
%t2 = shl ulong 1, ubyte 5
|
|
|
|
|
|
|
|
; Right shifts...
|
2006-12-31 06:02:00 +00:00
|
|
|
%tr1.s = shr int 1, ubyte %shamt
|
|
|
|
%tr2.s = shr int 1, ubyte 4
|
2003-01-13 00:57:49 +00:00
|
|
|
|
2003-11-26 14:45:37 +00:00
|
|
|
%tr1 = shr uint 1, ubyte %shamt
|
|
|
|
%tr2 = shr uint 1, ubyte 5
|
2003-01-13 00:57:49 +00:00
|
|
|
|
2003-11-26 14:45:37 +00:00
|
|
|
;%tr1 = shr long 1, ubyte %shamt
|
2006-12-31 06:02:00 +00:00
|
|
|
%tr1.l = shr long 1, ubyte 4
|
|
|
|
%tr2.l = shr long 1, ubyte %shamt
|
|
|
|
%tr3.l = shl long 1, ubyte 4
|
|
|
|
%tr4.l = shl long 1, ubyte %shamt
|
2003-01-13 00:57:49 +00:00
|
|
|
|
|
|
|
;%t1 = shr ulong 1, ubyte %shamt
|
2006-12-31 06:02:00 +00:00
|
|
|
%tr1.u = shr ulong 1, ubyte 5
|
|
|
|
%tr2.u = shr ulong 1, ubyte %shamt
|
|
|
|
%tr3.u = shl ulong 1, ubyte 5
|
|
|
|
%tr4.u = shl ulong 1, ubyte %shamt
|
2002-12-13 05:44:21 +00:00
|
|
|
ret int 0
|
2002-10-31 23:05:22 +00:00
|
|
|
}
|