[clang] [llvm] [Clang][LoongArch] Support target attribute for function (PR #140700)

via cfe-commits cfe-commits at lists.llvm.org
Sun May 25 23:55:46 PDT 2025


================
@@ -0,0 +1,19 @@
+// RUN: %clang_cc1 -triple loongarch64-linux-gnu  -fsyntax-only -verify %s
+
+// expected-error at +1 {{function multiversioning is not supported on the current target}}
+void __attribute__((target("default"))) bar(void){}
+
+// expected-error at +1 {{target(arch=..) attribute is not supported on targets missing invalid; specify an appropriate -march= or -mcpu=}}
+void __attribute__((target("arch=invalid"))) foo(void){}
+
+//expected-warning at +1 {{unsupported 'aaa' in the 'target' attribute string; 'target' attribute ignored}}
+int __attribute__((target("aaa"))) test_feature(void) { return 4; }
+
+//expected-warning at +1 {{unsupported 'aaa' in the 'target' attribute string; 'target' attribute ignored}}
----------------
Ami-zhang wrote:

Done.

https://github.com/llvm/llvm-project/pull/140700


More information about the cfe-commits mailing list