mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-08-05 13:26:55 +00:00
Two testcases for invalid transformations that instcombine is doing
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16446 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
20
test/Transforms/InstCombine/2004-09-20-BadLoadCombine.llx
Normal file
20
test/Transforms/InstCombine/2004-09-20-BadLoadCombine.llx
Normal file
@@ -0,0 +1,20 @@
|
||||
; RUN: llvm-as < %s | opt -instcombine -mem2reg | llvm-dis | not grep 'int 1'
|
||||
|
||||
; When propagating the load through the select, make sure that the load is
|
||||
; inserted where the original load was, not where the select is. Not doing
|
||||
; so could produce incorrect results!
|
||||
|
||||
implementation
|
||||
|
||||
int %test(bool %C) {
|
||||
%X = alloca int
|
||||
%X2 = alloca int
|
||||
store int 1, int* %X
|
||||
store int 2, int* %X2
|
||||
|
||||
%Y = select bool %C, int* %X, int* %X2
|
||||
store int 3, int* %X
|
||||
%Z = load int* %Y
|
||||
ret int %Z
|
||||
}
|
||||
|
Reference in New Issue
Block a user