1 ; RUN: opt < %s -passes=instsimplify -S | FileCheck %s
3 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
4 target triple = "x86_64-unknown-linux-gnu"
6 @a = external global i8
7 @b = external global i8
9 @c1 = constant i32 trunc (i64 sub (i64 ptrtoint (ptr @a to i64), i64 ptrtoint (ptr @c1 to i64)) to i32)
10 @c2 = constant [7 x i32] [i32 0, i32 0,
11 i32 trunc (i64 sub (i64 ptrtoint (ptr @a to i64), i64 ptrtoint (ptr getelementptr ([7 x i32], ptr @c2, i32 0, i32 2) to i64)) to i32),
12 i32 trunc (i64 sub (i64 ptrtoint (ptr @b to i64), i64 ptrtoint (ptr getelementptr ([7 x i32], ptr @c2, i32 0, i32 2) to i64)) to i32),
13 i32 trunc (i64 add (i64 ptrtoint (ptr @b to i64), i64 ptrtoint (ptr getelementptr ([7 x i32], ptr @c2, i32 0, i32 2) to i64)) to i32),
14 i32 trunc (i64 sub (i64 ptrtoint (ptr @b to i64), i64 1) to i32),
15 i32 trunc (i64 sub (i64 0, i64 ptrtoint (ptr getelementptr ([7 x i32], ptr @c2, i32 0, i32 2) to i64)) to i32)
21 %l = call ptr @llvm.load.relative.i32(ptr @c1, i32 0)
28 %l = call ptr @llvm.load.relative.i32(ptr getelementptr ([7 x i32], ptr @c2, i64 0, i64 2), i32 0)
35 %l = call ptr @llvm.load.relative.i64(ptr getelementptr ([7 x i32], ptr @c2, i64 0, i64 2), i64 4)
42 %l = call ptr @llvm.load.relative.i32(ptr getelementptr ([7 x i32], ptr @c2, i64 0, i64 2), i32 1)
49 %l = call ptr @llvm.load.relative.i32(ptr zeroinitializer, i32 0)
56 %l = call ptr @llvm.load.relative.i32(ptr getelementptr ([7 x i32], ptr @c2, i64 0, i64 2), i32 8)
63 %l = call ptr @llvm.load.relative.i32(ptr getelementptr ([7 x i32], ptr @c2, i64 0, i64 2), i32 12)
70 %l = call ptr @llvm.load.relative.i32(ptr getelementptr ([7 x i32], ptr @c2, i64 0, i64 2), i32 16)
74 declare ptr @llvm.load.relative.i32(ptr, i32)
75 declare ptr @llvm.load.relative.i64(ptr, i64)