llvm-6502/test/Transforms/InstCombine/2012-01-11-OpaqueBitcastCrash.ll
Duncan Sands 1876abe63e Don't try to create a GEP when the pointee type is unsized (such GEPs
are invalid).  Fixes a crash on array1.C from the GCC testsuite when
compiled with dragonegg.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@147946 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-11 12:20:08 +00:00

13 lines
277 B
LLVM

; RUN: opt < %s -instcombine -disable-output
%opaque_struct = type opaque
@G = external global [0 x %opaque_struct]
declare void @foo(%opaque_struct*)
define void @bar() {
call void @foo(%opaque_struct* bitcast ([0 x %opaque_struct]* @G to %opaque_struct*))
ret void
}