1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2 ; RUN: opt -passes=globalopt -S %s | FileCheck %s
4 %struct.global.20ptr = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }
6 @global.20ptr = internal unnamed_addr global %struct.global.20ptr zeroinitializer
12 define void @stores_single_use_gep_constexpr() {
13 ; CHECK-LABEL: @stores_single_use_gep_constexpr(
15 ; CHECK-NEXT: store ptr @fn0, ptr @global.20ptr, align 8
16 ; CHECK-NEXT: store ptr @fn1, ptr getelementptr inbounds ([[STRUCT_GLOBAL_20PTR:%.*]], ptr @global.20ptr, i64 0, i32 1), align 8
17 ; CHECK-NEXT: ret void
20 store ptr @fn0, ptr @global.20ptr, align 8
21 store ptr @fn1, ptr getelementptr inbounds (%struct.global.20ptr, ptr @global.20ptr, i64 0, i32 1), align 8
25 define void @stores_ptrtoint_constexpr() {
26 ; CHECK-LABEL: @stores_ptrtoint_constexpr(
28 ; CHECK-NEXT: store i32 0, ptr inttoptr (i64 add (i64 ptrtoint (ptr @global.20ptr to i64), i64 200) to ptr), align 8
29 ; CHECK-NEXT: ret void
32 store i32 0, ptr inttoptr (i64 add (i64 ptrtoint (ptr @global.20ptr to i64), i64 200) to ptr), align 8