1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-24 11:42:57 +01:00
llvm-mirror/test/Transforms/GVN/pr28562.ll
David Majnemer f7d30cf67a [IR] andIRFlags and copyIRFlags needs to handle GEP
We didn't consider the inbounds flag on GEPs leading to downstream users
introducing UB.

This fixes PR28562.

llvm-svn: 275532
2016-07-15 05:02:31 +00:00

10 lines
285 B
LLVM

; RUN: opt -S -gvn < %s | FileCheck %s
define i32* @test1(i32* %a) {
%x1 = getelementptr inbounds i32, i32* %a, i32 10
%x2 = getelementptr i32, i32* %a, i32 10
ret i32* %x2
; CHECK-LABEL: @test1(
; CHECK: %[[x:.*]] = getelementptr i32, i32* %a, i32 10
; CHECK: ret i32* %[[x]]
}