new testcase for PR905
[oota-llvm.git] / test / Transforms / InstCombine / 2006-09-11-EmptyStructCrash.ll
1 ; RUN: llvm-as < %s | opt -instcombine -disable-output
2 ; PR905
3
4         %RPYTHON_EXCEPTION = type { %RPYTHON_EXCEPTION_VTABLE* }
5         %RPYTHON_EXCEPTION_VTABLE = type { %RPYTHON_EXCEPTION_VTABLE*, int, int, %RPyOpaque_RuntimeTypeInfo*, %arraytype_Char*, %functiontype_12* }
6         %RPyOpaque_RuntimeTypeInfo = type opaque*
7         %arraytype_Char = type { int, [0 x sbyte] }
8         %fixarray_array1019 = type [1019 x sbyte*]
9         %functiontype_12 = type %RPYTHON_EXCEPTION* ()
10         %functiontype_14 = type void (%structtype_pypy.rpython.memory.gc.MarkSweepGC*)
11         %structtype_AddressLinkedListChunk = type { %structtype_AddressLinkedListChunk*, int, %fixarray_array1019 }
12         %structtype_exceptions.Exception = type { %RPYTHON_EXCEPTION }
13         %structtype_gc_pool = type {  }
14         %structtype_gc_pool_node = type { %structtype_header*, %structtype_gc_pool_node* }
15         %structtype_header = type { int, %structtype_header* }
16         %structtype_pypy.rpython.memory.gc.MarkSweepGC = type { %structtype_exceptions.Exception, int, int, bool, %structtype_gc_pool*, int, %structtype_header*, %structtype_header*, %structtype_gc_pool_node*, double, double }
17
18 implementation   ; Functions:
19
20 fastcc void %pypy_MarkSweepGC.collect() {
21 block0:
22         %v1221 = load %structtype_AddressLinkedListChunk** null         ; <%structtype_AddressLinkedListChunk*> [#uses=1]
23         %v1222 = setne %structtype_AddressLinkedListChunk* %v1221, null         ; <bool> [#uses=1]
24         br bool %v1222, label %block79, label %block4
25
26 block4:         ; preds = %block0
27         ret void
28
29 block22:                ; preds = %block79
30         ret void
31
32 block67:                ; preds = %block79
33         %v1459 = load %structtype_gc_pool** null                ; <%structtype_gc_pool*> [#uses=1]
34         %v1460 = cast %structtype_gc_pool* %v1459 to sbyte*             ; <sbyte*> [#uses=1]
35         %tmp_873 = cast sbyte* %v1460 to int            ; <int> [#uses=1]
36         %tmp_874 = sub int %tmp_873, 0          ; <int> [#uses=1]
37         %v1461 = cast int %tmp_874 to sbyte*            ; <sbyte*> [#uses=1]
38         %v1462 = cast sbyte* %v1461 to %structtype_header*              ; <%structtype_header*> [#uses=1]
39         %tmp_876 = getelementptr %structtype_header* %v1462, int 0, uint 0              ; <int*> [#uses=1]
40         store int 0, int* %tmp_876
41         ret void
42
43 block79:                ; preds = %block0
44         %v1291 = load %structtype_gc_pool** null                ; <%structtype_gc_pool*> [#uses=1]
45         %v1292 = setne %structtype_gc_pool* %v1291, null                ; <bool> [#uses=1]
46         br bool %v1292, label %block67, label %block22
47 }