summaryrefslogtreecommitdiffstats
path: root/llvm/test/Other/optimize-inrange-gep.ll
blob: 9e86889be9c7fd4d747b5e536ca9c7e4017be6a0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
; RUN: opt -O0 -S < %s | FileCheck %s
; RUN: opt -O1 -S < %s | FileCheck %s
; RUN: opt -O2 -S < %s | FileCheck %s
; RUN: opt -O3 -S < %s | FileCheck %s
; RUN: opt -Os -S < %s | FileCheck %s
; RUN: opt -Oz -S < %s | FileCheck %s

target datalayout = "e-p:64:64"

; Make sure that optimizations do not optimize inrange GEP.

@vtable = constant { [3 x i8*] } { [3 x i8*] [i8* null, i8* null, i8* null] }

define void @foo(i8*** %p) {
  ;CHECK: store i8** getelementptr {{.*}} ({ [3 x i8*] }, { [3 x i8*] }* @vtable, i{{.*}} 0, inrange i32 0, i{{.*}} 3), i8*** %p
  store i8** getelementptr ({ [3 x i8*] }, { [3 x i8*] }* @vtable, i32 0, inrange i32 0, i32 3), i8*** %p
  ret void
}
OpenPOWER on IntegriCloud