1 ; RUN: opt -O0 -S < %s | FileCheck %s
2 ; RUN: opt -O1 -S < %s | FileCheck %s
3 ; RUN: opt -O2 -S < %s | FileCheck %s
4 ; RUN: opt -O3 -S < %s | FileCheck %s
5 ; RUN: opt -Os -S < %s | FileCheck %s
6 ; RUN: opt -Oz -S < %s | FileCheck %s
8 target datalayout = "e-p:64:64"
10 ; Make sure that optimizations do not optimize inrange GEP.
12 @vtable = constant { [3 x ptr] } { [3 x ptr] [ptr null, ptr null, ptr null] }
14 define void @foo(ptr %p) {
15 ;CHECK: store ptr getelementptr {{.*}} ({ [3 x ptr] }, ptr @vtable, i{{.*}} 0, inrange i32 0, i{{.*}} 3), ptr %p
16 store ptr getelementptr ({ [3 x ptr] }, ptr @vtable, i32 0, inrange i32 0, i32 3), ptr %p