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

38 lines
1.0 KiB
LLVM

; RUN: llc -O0 -mtriple=hexagon -relocation-model=pic < %s | FileCheck %s
@dst_ie = thread_local(initialexec) global i32 0, align 4
@src_ie = thread_local(initialexec) global i32 0, align 4
; CHECK-LABEL: test_initial_exec
; CHECK-DAG: = add(pc,##_GLOBAL_OFFSET_TABLE_@PCREL)
; CHECK-DAG: ##src_ie@IEGOT
; CHECK-DAG: ##dst_ie@IEGOT
; CHECK-NOT: call
define i32 @test_initial_exec() nounwind {
entry:
%0 = load i32, ptr @src_ie, align 4
store i32 %0, ptr @dst_ie, align 4
ret i32 0
}
@dst_gd = external thread_local global i32
@src_gd = external thread_local global i32
; At the moment, the local-dynamic model uses the same code as the
; general-dynamic model.
; CHECK-LABEL: test_dynamic
; CHECK-DAG: = add(pc,##_GLOBAL_OFFSET_TABLE_@PCREL)
; CHECK-DAG: ##src_gd@GDGOT
; CHECK-DAG: ##dst_gd@GDGOT
; CHECK-DAG: call src_gd@GDPLT
; CHECK-DAG: call dst_gd@GDPLT
define i32 @test_dynamic() nounwind {
entry:
%0 = load i32, ptr @src_gd, align 4
store i32 %0, ptr @dst_gd, align 4
ret i32 0
}