mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-04 05:31:06 +00:00
01853e8773
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2424 91177308-0d34-0410-b5e6-96231b3b80d8
28 lines
484 B
LLVM
28 lines
484 B
LLVM
; The %A getelementptr instruction should be eliminated here
|
|
|
|
; RUN: if as < %s | opt -instcombine -dce | dis | grep getelementptr | grep '%A'
|
|
; RUN: then exit 1
|
|
; RUN: else exit 0
|
|
; RUN: fi
|
|
|
|
implementation
|
|
|
|
int *"foo"(int * %I)
|
|
begin
|
|
%A = getelementptr int* %I, uint 17
|
|
store int 23, int* %A
|
|
|
|
%B = load int* %A
|
|
store int %B, int* %A, uint 0
|
|
|
|
%C = getelementptr int* %A
|
|
ret int* %C
|
|
end
|
|
|
|
int *"foo2"(int * %I)
|
|
begin
|
|
%A = getelementptr int* %I, uint 0 ; Noop
|
|
ret int * %A
|
|
end
|
|
|