llvm-project/llvm/test/CodeGen/AArch64/stackguard-internal.ll
Fangrui Song 28bda77843
Introduce MCAsmInfo::UsesSetToEquateSymbol and prefer = to .set
Introduce MCAsmInfo::UsesSetToEquateSymbol to control the preferred
syntax for symbol equating. We now favor the more readable and common
`symbol = expression` syntax over `.set`. This aligns with pre- https://reviews.llvm.org/D44256 behavior.

On Apple platforms, this resolves a clang -S vs -c behavior difference (resolves #104623).

For targets whose = support is unconfirmed, UsesSetToEquateSymbol is set to false.
This also minimizes test updates.

Pull Request: https://github.com/llvm/llvm-project/pull/142289
2025-06-11 22:19:31 -07:00

21 lines
734 B
LLVM

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