llvm-project/llvm/test/CodeGen/Hexagon/global-ctor-pcrel.ll
Fangrui Song 2208c97c1b [Hexagon,test] Change llc -march= to -mtriple=
Similar to 806761a7629df268c8aed49657aeccffa6bca449

-mtriple= specifies the full target triple while -march= merely sets the
architecture part of the default target triple, leaving a target triple which
may not make sense.

Therefore, -march= is error-prone and not recommended for tests without a target
triple. The issue has been benign as we recognize $unknown-apple-darwin as ELF instead
of rejecting it outrightly.
2024-12-15 10:20:22 -08:00

51 lines
1.0 KiB
LLVM

; RUN: llc -mtriple=hexagon < %s | FileCheck %s
; CHECK-NOT: pcrelR0
target triple = "hexagon"
%s.0 = type { i32, i32 }
@g0 = global %s.0 zeroinitializer, align 4
@e0 = alias void (ptr, i32, i32), ptr @f0
; Function Attrs: nounwind
define void @f0(ptr %a0, i32 %a1, i32 %a2) unnamed_addr #0 align 2 {
b0:
%v0 = alloca ptr, align 4
%v1 = alloca i32, align 4
%v2 = alloca i32, align 4
store ptr %a0, ptr %v0, align 4
store i32 %a1, ptr %v1, align 4
store i32 %a2, ptr %v2, align 4
%v3 = load ptr, ptr %v0
%v5 = load i32, ptr %v2, align 4
store i32 %v5, ptr %v3, align 4
%v6 = getelementptr inbounds %s.0, ptr %v3, i32 0, i32 1
%v7 = load i32, ptr %v1, align 4
store i32 %v7, ptr %v6, align 4
ret void
}
define internal void @f1() {
b0:
call void @e0(ptr @g0, i32 3, i32 7)
ret void
}
; Function Attrs: nounwind
define i32 @f2() #0 {
b0:
%v0 = alloca i32, align 4
store i32 0, ptr %v0
ret i32 0
}
define internal void @f3() {
b0:
call void @f1()
ret void
}
attributes #0 = { nounwind }