llvm-project/llvm/test/CodeGen/ARM/global-merge-dllexport.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

22 lines
577 B
LLVM

; RUN: llc < %s -mtriple=thumbv7-win32 -arm-global-merge | FileCheck %s
@x = global i32 0, align 4
@y = dllexport global i32 0, align 4
define void @f1(i32 %a1, i32 %a2) {
; CHECK: f1:
; CHECK: movw [[REG1:r[0-9]+]], :lower16:.L_MergedGlobals
; CHECK: movt [[REG1]], :upper16:.L_MergedGlobals
store i32 %a1, ptr @x, align 4
store i32 %a2, ptr @y, align 4
ret void
}
; CHECK: .lcomm .L_MergedGlobals,8,4
; CHECK: .section .drectve,"yni"
; CHECK: .ascii " /EXPORT:y,DATA"
; CHECK: .globl x
; CHECK: x = .L_MergedGlobals
; CHECK: .globl y
; CHECK: y = .L_MergedGlobals+4