Skip to content

Conversation

mcinally
Copy link
Contributor

@mcinally mcinally commented Sep 19, 2025

It's not possible to use -mcpu=native when the Target's Triple doesn't match the Host's. Move this test to the X86 directory so that it isn't run while cross-compiling.

Originally #159414

It's not possible to use `-mcpu=native` when the Target's Triple doesn't match
the Host's. Move this test to the AArch64 directory so that it isn't run while
cross-compiling.

Originally llvm#159414
@llvmbot
Copy link
Member

llvmbot commented Sep 19, 2025

@llvm/pr-subscribers-backend-x86

@llvm/pr-subscribers-backend-aarch64

Author: Cameron McInally (mcinally)

Changes

It's not possible to use -mcpu=native when the Target's Triple doesn't match the Host's. Move this test to the AArch64 directory so that it isn't run while cross-compiling.

Originally #159414


Full diff: https://github.com/llvm/llvm-project/pull/159868.diff

2 Files Affected:

  • (added) llvm/test/MC/AArch64/mcpu-native.s (+5)
  • (removed) llvm/test/MC/AsmParser/native.s (-4)
diff --git a/llvm/test/MC/AArch64/mcpu-native.s b/llvm/test/MC/AArch64/mcpu-native.s
new file mode 100644
index 0000000000000..56c216091372b
--- /dev/null
+++ b/llvm/test/MC/AArch64/mcpu-native.s
@@ -0,0 +1,5 @@
+# REQUIRES: aarch64-registered-target,system-linux,aarch64-host
+# RUN: llvm-mc -triple=aarch64 -filetype=obj -o %t -mcpu=native %s 2> %t.stderr
+# RUN: FileCheck --allow-empty %s < %t.stderr
+
+# CHECK-NOT: {{.+}}
diff --git a/llvm/test/MC/AsmParser/native.s b/llvm/test/MC/AsmParser/native.s
deleted file mode 100644
index 4da5b3717913f..0000000000000
--- a/llvm/test/MC/AsmParser/native.s
+++ /dev/null
@@ -1,4 +0,0 @@
-# RUN: llvm-mc -filetype=obj -o %t -mcpu=native %s 2> %t.stderr
-# RUN: FileCheck --allow-empty %s < %t.stderr
-
-# CHECK-NOT: {{.+}}

X86 has more convenient REQUIRES features. Use them.
Copy link
Contributor

@s-barannikov s-barannikov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks

@s-barannikov
Copy link
Contributor

Please update the description, it still mentions AArch64

@mcinally mcinally enabled auto-merge (squash) September 20, 2025 00:42
@mcinally mcinally disabled auto-merge September 20, 2025 00:52
@mcinally mcinally enabled auto-merge (squash) September 20, 2025 00:52
@mcinally mcinally merged commit 5b017e3 into llvm:main Sep 20, 2025
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants