mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-02 22:32:38 +00:00
16 lines
316 B
LLVM
16 lines
316 B
LLVM
|
; Test that pure functions are cse'd away
|
||
|
|
||
|
; RUN: llvm-as < %s | opt -globalsmodref-aa -load-vn -gcse -instcombine -adce| llvm-dis | not grep call
|
||
|
|
||
|
int %pure(int %X) {
|
||
|
%Y = add int %X, 1
|
||
|
ret int %Y
|
||
|
}
|
||
|
|
||
|
int %test(int %X) {
|
||
|
%A = call int %pure(int %X)
|
||
|
%B = call int %pure(int %X)
|
||
|
%C = sub int %A, %B
|
||
|
ret int %C
|
||
|
}
|