From d162b7774dfcef3c48dd59287f4b45533dbafd4d Mon Sep 17 00:00:00 2001 From: Cameron McInally Date: Fri, 19 Sep 2025 15:56:03 -0700 Subject: [PATCH 1/2] [MC] Make `-mcpu=native` test target specific 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 --- llvm/test/MC/AArch64/mcpu-native.s | 5 +++++ llvm/test/MC/AsmParser/native.s | 4 ---- 2 files changed, 5 insertions(+), 4 deletions(-) create mode 100644 llvm/test/MC/AArch64/mcpu-native.s delete mode 100644 llvm/test/MC/AsmParser/native.s 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: {{.+}} From b7f36836704b48269c98d516f405203c19491335 Mon Sep 17 00:00:00 2001 From: Cameron McInally Date: Fri, 19 Sep 2025 17:25:09 -0700 Subject: [PATCH 2/2] Move AArch64 test to X86. X86 has more convenient REQUIRES features. Use them. --- llvm/test/MC/AArch64/mcpu-native.s | 5 ----- llvm/test/MC/X86/mcpu-native.s | 5 +++++ 2 files changed, 5 insertions(+), 5 deletions(-) delete mode 100644 llvm/test/MC/AArch64/mcpu-native.s create mode 100644 llvm/test/MC/X86/mcpu-native.s diff --git a/llvm/test/MC/AArch64/mcpu-native.s b/llvm/test/MC/AArch64/mcpu-native.s deleted file mode 100644 index 56c216091372b..0000000000000 --- a/llvm/test/MC/AArch64/mcpu-native.s +++ /dev/null @@ -1,5 +0,0 @@ -# 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/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: {{.+}}