Kuba (Brecka) Mracek 454cc36630
[AArch64] Relax binary format switch in AArch64MCInstLower::LowerSymbolOperand to allow non-Darwin Mach-O files (#66011)
Trying to use a arm64-apple-none-macho target triple today crashes with
an assertion, this patch fixes that.
2023-09-14 11:12:30 -07:00

17 lines
475 B
LLVM

; RUN: llc -mtriple=arm64-apple-none-elf %s -o - | FileCheck %s --check-prefix CHECK-ELF
; RUN: llc -mtriple=arm64-apple-none-macho %s -o - | FileCheck %s --check-prefix CHECK-MACHO
@var = global i8 0
define i8 @foo() {
%x = load i8, ptr @var
; CHECK-ELF: adrp x{{[0-9]+}}, :got:var
; CHECK-ELF: ldr x{{[0-9]+}}, [x{{[0-9]+}}, :got_lo12:var]
; CHECK-MACHO: adrp x{{[0-9]+}}, _var@PAGE
; CHECK-MACHO: ldrb w{{[0-9]+}}, [x{{[0-9]+}}, _var@PAGEOFF]
ret i8 %x
}