[clang] [Driver][X86] Add -m[no-]apxf to m_x86_Features_Group (PR #140874)
Shengchen Kan via cfe-commits
cfe-commits at lists.llvm.org
Thu May 22 20:54:04 PDT 2025
================
@@ -135,3 +135,53 @@
void f(void) {
}
+
+
+// RUN: not %clang_cl -### --target=i386 -mapx-features=ndd %s 2>&1 | FileCheck --check-prefix=NON-APX %s
+// RUN: not %clang_cl -### --target=i386 -mapxf %s 2>&1 | FileCheck --check-prefix=NON-APX %s
+// RUN: %clang_cl -### --target=i386 -mno-apxf %s 2>&1 > /dev/null
+// NON-APX: error: unsupported option '-mapx-features=|-mapxf' for target 'i386'
+// NON-APX-NOT: error: {{.*}} -mapx-features=
+
+// RUN: %clang_cl -target x86_64-pc-windows -mapxf %s -### -o %t.o 2>&1 | FileCheck -check-prefix=APXF %s
+// RUN: %clang_cl -target x86_64-pc-windows -mno-apxf %s -### -o %t.o 2>&1 | FileCheck -check-prefix=NO-APXF %s
+// RUN: %clang_cl -target x86_64-pc-windows -mno-apxf -mapxf %s -### -o %t.o 2>&1 | FileCheck -check-prefix=APXF %s
+// RUN: %clang_cl -target x86_64-pc-windows -mapxf -mno-apxf %s -### -o %t.o 2>&1 | FileCheck -check-prefix=NO-APXF %s
+//
+// APXF: "-target-feature" "+egpr" "-target-feature" "+push2pop2" "-target-feature" "+ppx" "-target-feature" "+ndd" "-target-feature" "+ccmp" "-target-feature" "+nf" "-target-feature" "+cf" "-target-feature" "+zu"
+// NO-APXF: "-target-feature" "-egpr" "-target-feature" "-push2pop2" "-target-feature" "-ppx" "-target-feature" "-ndd" "-target-feature" "-ccmp" "-target-feature" "-nf" "-target-feature" "-cf" "-target-feature" "-zu"
+
+// RUN: %clang_cl -target x86_64-pc-windows -mapx-features=egpr %s -### -o %t.o 2>&1 | FileCheck -check-prefix=EGPR %s
----------------
KanRobert wrote:
Should we only test -m[no-]apxf/, -mapx-features are usable for clang-cl? Since other tests are already tested on clang side. @fzou1
https://github.com/llvm/llvm-project/pull/140874
More information about the cfe-commits
mailing list