1 ; RUN: llc -O3 %s -o - | FileCheck %s
2 target datalayout = "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128"
3 target triple = "aarch64-linux-gnu"
5 ; Make sure we correctly lower stack guards even if __stack_chk_guard
6 ; is an alias. (The alias is created by GlobalMerge.)
7 ; CHECK: adrp {{.*}}, __stack_chk_guard
8 ; CHECK: ldr {{.*}}, [{{.*}}, :lo12:__stack_chk_guard]
9 ; CHECK: .set __stack_chk_guard, .L_MergedGlobals+4
11 @__stack_chk_guard = internal global [8 x i32] zeroinitializer, align 4
12 @x = internal global i32 0, align 4
14 define i32 @b() nounwind sspstrong {
16 %z = alloca [10 x i32], align 4
17 %arraydecay = getelementptr inbounds [10 x i32], [10 x i32]* %z, i64 0, i64 0
18 %call = call i32 @a(i32* getelementptr inbounds ([8 x i32], [8 x i32]* @__stack_chk_guard, i64 0, i64 0), i32* nonnull @x, i32* nonnull %arraydecay) #3
21 declare i32 @a(i32*, i32*, i32*)