xref: /aosp_15_r20/external/llvm/test/CodeGen/ARM/2011-11-30-MergeAlignment.ll (revision 9880d6810fe72a1726cb53787c6711e909410d58)
1*9880d681SAndroid Build Coastguard Worker; RUN: llc < %s | FileCheck %s
2*9880d681SAndroid Build Coastguard Worker; <rdar://problem/10497732>
3*9880d681SAndroid Build Coastguard Worker
4*9880d681SAndroid Build Coastguard Workertarget datalayout = "e-p:32:32:32-i1:8:32-i8:8:32-i16:16:32-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:32:64-v128:32:128-a0:0:32-n32"
5*9880d681SAndroid Build Coastguard Workertarget triple = "thumbv7-apple-darwin10"
6*9880d681SAndroid Build Coastguard Worker
7*9880d681SAndroid Build Coastguard Worker@x1 = internal global i32 1
8*9880d681SAndroid Build Coastguard Worker@x2 = internal global i64 12
9*9880d681SAndroid Build Coastguard Worker
10*9880d681SAndroid Build Coastguard Workerdefine i64 @f() {
11*9880d681SAndroid Build Coastguard Worker  %ax = load i32, i32* @x1
12*9880d681SAndroid Build Coastguard Worker  %a = zext i32 %ax to i64
13*9880d681SAndroid Build Coastguard Worker  %b = load i64, i64* @x2
14*9880d681SAndroid Build Coastguard Worker  %c = add i64 %a, %b
15*9880d681SAndroid Build Coastguard Worker  ret i64 %c
16*9880d681SAndroid Build Coastguard Worker}
17*9880d681SAndroid Build Coastguard Worker
18*9880d681SAndroid Build Coastguard Worker; We can global-merge the i64 in theory, but the current code doesn't handle
19*9880d681SAndroid Build Coastguard Worker; the alignment correctly; for the moment, just check that we don't do it.
20*9880d681SAndroid Build Coastguard Worker; See also
21*9880d681SAndroid Build Coastguard Worker
22*9880d681SAndroid Build Coastguard Worker; CHECK-NOT: MergedGlobals
23*9880d681SAndroid Build Coastguard Worker; CHECK: _x2
24*9880d681SAndroid Build Coastguard Worker; CHECK-NOT: MergedGlobals
25