blob: 1fa2fd8253b35c1f7401314c1b1cc8da7ce89008 [file] [log] [blame]
Tanya Lattner12ff9682004-11-06 20:38:27 +00001; XFAIL: *
Chris Lattner61b06472002-04-16 05:44:56 +00002; this testcase is distilled from this C source:
3; int *foo(unsigned N, unsigned M) {
4; unsigned i = (N+1)*sizeof(int);
5; unsigned j = (M+1)*sizeof(int);
6; return (int*)malloc(i+j);
7; }
8
Reid Spencer3da59db2006-11-27 01:05:10 +00009; RUN: llvm-as < %s | opt -raise | llvm-dis | not grep bitcast
Chris Lattner61b06472002-04-16 05:44:56 +000010
11implementation
12
Chris Lattner5944ba62003-06-28 23:02:20 +000013int* %test(uint %N, uint %M) {
Chris Lattner61b06472002-04-16 05:44:56 +000014 %reg111 = shl uint %N, ubyte 2 ; <uint> [#uses=1]
15 %reg109 = add uint %reg111, 4 ; <uint> [#uses=1]
16 %reg114 = shl uint %M, ubyte 2 ; <uint> [#uses=1]
17 %reg112 = add uint %reg114, 4 ; <uint> [#uses=1]
18 %reg116 = add uint %reg109, %reg112 ; <uint> [#uses=1]
19 %reg117 = malloc sbyte, uint %reg116 ; <sbyte*> [#uses=1]
20 %cast221 = cast sbyte* %reg117 to int* ; <int*> [#uses=1]
21 ret int* %cast221
Chris Lattner5944ba62003-06-28 23:02:20 +000022}