blob: 9e86889be9c7fd4d747b5e536ca9c7e4017be6a0 [file] [log] [blame]
Peter Collingbournec7d28192018-09-11 01:53:36 +00001; 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
7
8target datalayout = "e-p:64:64"
9
10; Make sure that optimizations do not optimize inrange GEP.
11
12@vtable = constant { [3 x i8*] } { [3 x i8*] [i8* null, i8* null, i8* null] }
13
14define void @foo(i8*** %p) {
15 ;CHECK: store i8** getelementptr {{.*}} ({ [3 x i8*] }, { [3 x i8*] }* @vtable, i{{.*}} 0, inrange i32 0, i{{.*}} 3), i8*** %p
16 store i8** getelementptr ({ [3 x i8*] }, { [3 x i8*] }* @vtable, i32 0, inrange i32 0, i32 3), i8*** %p
17 ret void
18}