1 ; Problem that occured because of obsolete code that only allowed malloc
2 ; instructions to change type if they were 'array' allocations. This
3 ; prevented reg115 from being able to change.
6 ; RUN: if as < %s | opt -raise | dis | grep '= cast' | grep \*
11 %Hash = type { { uint, sbyte *, \2 } * *, int (uint) *, int } *
12 %HashEntry = type { uint, sbyte *, \2 } *
13 %hash = type { { uint, sbyte *, \2 } * *, int (uint) *, int }
14 %hash_entry = type { uint, sbyte *, \2 * }
17 %Hash "MakeHash"(int %size, int (uint) * %map)
20 %reg112 = malloc sbyte * *, uint 3 ; <sbyte * * *> [#uses=4]
21 %reg115 = malloc sbyte *, uint 1 ; <sbyte * *> [#uses=1]
22 store sbyte * * %reg115, sbyte * * * %reg112
23 %reg121 = load sbyte * * * %reg112 ; <sbyte * *> [#uses=1]
24 %size-idxcast1 = cast int %size to long ; <uint> [#uses=1]
25 %reg1221 = getelementptr sbyte * * %reg121, long %size-idxcast1 ; <sbyte * *> [#uses=1]
26 store sbyte * null, sbyte * * %reg1221
27 %reg232 = getelementptr sbyte * * * %reg112, long 1 ; <sbyte * * *> [#uses=1]
28 %cast243 = cast int (uint) * %map to sbyte * * ; <sbyte * *> [#uses=1]
29 store sbyte * * %cast243, sbyte * * * %reg232
30 %cast246 = cast sbyte * * * %reg112 to %Hash ; <%Hash> [#uses=1]