1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2 ; RUN: opt -S -separate-const-offset-from-gep < %s | FileCheck %s
4 @e = external global [4000 x i8], align 1
6 define void @find_either_reset() {
7 ; CHECK-LABEL: @find_either_reset(
9 ; CHECK-NEXT: [[SUB:%.*]] = sub nsw i32 65536, undef
10 ; CHECK-NEXT: [[TMP0:%.*]] = trunc i32 [[SUB]] to i8
11 ; CHECK-NEXT: [[TMP1:%.*]] = add i8 [[TMP0]], 96
12 ; CHECK-NEXT: [[IDXPROM:%.*]] = sext i8 0 to i64
13 ; CHECK-NEXT: [[IDXPROM1:%.*]] = sext i8 [[TMP1]] to i64
14 ; CHECK-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds [4000 x i8], [4000 x i8]* @e, i64 [[IDXPROM]], i64 [[IDXPROM1]]
15 ; CHECK-NEXT: ret void
18 %sub = sub nsw i32 65536, undef
19 %0 = trunc i32 %sub to i8
21 %arrayidx = getelementptr inbounds [4000 x i8], [4000 x i8]* @e, i8 0, i8 %1