mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-21 00:32:23 +00:00
5b7cfb02f7
clean up when using variable length arrays in llvm-gcc. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65832 91177308-0d34-0410-b5e6-96231b3b80d8
15 lines
436 B
LLVM
15 lines
436 B
LLVM
; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep {getelementptr i32}
|
|
; PR3694
|
|
|
|
define i32 @e(i32 %m, i32 %n) nounwind {
|
|
entry:
|
|
%0 = alloca i32, i32 %n, align 4 ; <i32*> [#uses=2]
|
|
%1 = bitcast i32* %0 to [0 x i32]* ; <[0 x i32]*> [#uses=1]
|
|
call void @f(i32* %0) nounwind
|
|
%2 = getelementptr [0 x i32]* %1, i32 0, i32 %m ; <i32*> [#uses=1]
|
|
%3 = load i32* %2, align 4 ; <i32> [#uses=1]
|
|
ret i32 %3
|
|
}
|
|
|
|
declare void @f(i32*)
|