Similar to 806761a762
-mtriple= specifies the full target triple while -march= merely sets the
architecture part of the default target triple (e.g. Windows, macOS),
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 xcore-apple-darwin as ELF instead
of rejecting it outrightly.
35 lines
596 B
LLVM
35 lines
596 B
LLVM
; RUN: llc < %s -mtriple=xcore | FileCheck %s
|
|
define void @a_val() nounwind {
|
|
ret void
|
|
}
|
|
@b_val = constant i32 42, section ".cp.rodata"
|
|
@c_val = global i32 42
|
|
|
|
@a = alias void (), ptr @a_val
|
|
@b = alias i32, ptr @b_val
|
|
@c = alias i32, ptr @c_val
|
|
|
|
; CHECK-LABEL: a_addr:
|
|
; CHECK: ldap r11, a
|
|
; CHECK: retsp
|
|
define ptr @a_addr() nounwind {
|
|
entry:
|
|
ret ptr @a
|
|
}
|
|
|
|
; CHECK-LABEL: b_addr:
|
|
; CHECK: ldaw r11, cp[b]
|
|
; CHECK: retsp
|
|
define ptr @b_addr() nounwind {
|
|
entry:
|
|
ret ptr @b
|
|
}
|
|
|
|
; CHECK-LABEL: c_addr:
|
|
; CHECK: ldaw r0, dp[c]
|
|
; CHECK: retsp
|
|
define ptr @c_addr() nounwind {
|
|
entry:
|
|
ret ptr @c
|
|
}
|