1 ; RUN: opt -global-merge -global-merge-max-offset=100 -S -o - %s | FileCheck %s
3 target datalayout = "e-p:64:64"
4 target triple = "x86_64-unknown-linux-gnu"
6 ; CHECK: @_MergedGlobals = private global <{ i32, i32 }> <{ i32 3, i32 3 }>, align 4
8 @a = internal global i32 1
10 @b = internal global i32 2
12 @c = internal global i32 3
14 @d = internal global i32 3
16 @llvm.used = appending global [1 x ptr] [ptr @a], section "llvm.metadata"
17 @llvm.compiler.used = appending global [1 x ptr] [ptr @b], section "llvm.metadata"
20 ; CHECK: load i32, ptr @a
22 ; CHECK: load i32, ptr @b
24 ; CHECK: load i32, ptr @_MergedGlobals
25 %z1 = load i32, ptr @c
26 ; CHECK: load i32, ptr getelementptr inbounds (<{ i32, i32 }>, ptr @_MergedGlobals, i32 0, i32 1)
27 %z2 = load i32, ptr @d