[llvm] 5b017e3 - [MC] Make `-mcpu=native` test target specific (#159868)

via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 19 18:07:15 PDT 2025


Author: Cameron McInally
Date: 2025-09-20T01:07:11Z
New Revision: 5b017e3884956bc9bd65f91f86c0ccbbaa7fc653

URL: https://github.com/llvm/llvm-project/commit/5b017e3884956bc9bd65f91f86c0ccbbaa7fc653
DIFF: https://github.com/llvm/llvm-project/commit/5b017e3884956bc9bd65f91f86c0ccbbaa7fc653.diff

LOG: [MC] Make `-mcpu=native` test target specific (#159868)

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

---------

Co-authored-by: Cameron McInally <cmcinally at nvidia.com>

Added: 
    llvm/test/MC/X86/mcpu-native.s

Modified: 
    

Removed: 
    llvm/test/MC/AsmParser/native.s


################################################################################
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: {{.+}}

diff  --git a/llvm/test/MC/X86/mcpu-native.s b/llvm/test/MC/X86/mcpu-native.s
new file mode 100644
index 0000000000000..e8d050cc25dfc
--- /dev/null
+++ b/llvm/test/MC/X86/mcpu-native.s
@@ -0,0 +1,5 @@
+# REQUIRES: host=x86_64-{{.*}}
+# RUN: llvm-mc -triple=x86_64 -filetype=obj -o %t -mcpu=native %s 2> %t.stderr
+# RUN: FileCheck --allow-empty %s < %t.stderr
+
+# CHECK-NOT: {{.+}}


        


More information about the llvm-commits mailing list