1 ; RUN: opt < %s -instcombine -S | FileCheck %s
3 ; Don't assume that external global variables or those with weak linkage have
4 ; their preferred alignment. They may only have the ABI minimum alignment.
6 target datalayout = "i32:8:32"
8 @A = external global i32
9 @B = weak_odr global i32 0
11 @C = available_externally global <4 x i32> zeroinitializer, align 4
12 ; CHECK: @C = available_externally global <4 x i32> zeroinitializer, align 4
14 define i64 @foo(i64 %a) {
15 %t = ptrtoint i32* @A to i64
22 ; CHECK-LABEL: define i64 @foo(i64 %a)
23 ; CHECK: %s = shl i64 %a, 3
24 ; CHECK: %r = or i64 %s, ptrtoint (i32* @A to i64)
25 ; CHECK: %q = add i64 %r, 1
29 %r = load i32, i32* @B, align 1
36 define void @vec_store() {
37 store <4 x i32> <i32 0, i32 1, i32 2, i32 3>, <4 x i32>* @C, align 4
40 ; CHECK: define void @vec_store()
41 ; CHECK: store <4 x i32> <i32 0, i32 1, i32 2, i32 3>, <4 x i32>* @C, align 4