================
@@ -109,9 +109,22 @@ int unused_with_implicit_default_def(void) { return 1; }
 int unused_with_implicit_forward_default_def(void) { return 0; }
 __attribute__((target_version("lse"))) int 
unused_with_implicit_forward_default_def(void) { return 1; }
 
-// This should generate a normal function.
+// This should generate a target version despite the default not being 
declared.
 __attribute__((target_version("rdm"))) int unused_without_default(void) { 
return 0; }
 
+// The following is guarded because in NOFMV we get errors for calling 
undeclared functions.
+#ifdef __HAVE_FUNCTION_MULTI_VERSIONING
+// This should generate a default declaration, two target versions and the 
resolver.
+__attribute__((target_version("jscvt"))) int 
used_def_without_default_decl(void) { return 1; }
+__attribute__((target_version("rdma"))) int 
used_def_without_default_decl(void) { return 2; }
+
+// This should generate a default declaration and the resolver.
+__attribute__((target_version("jscvt"))) int 
used_decl_without_default_decl(void);
+__attribute__((target_version("rdma"))) int 
used_decl_without_default_decl(void);
+
+int caller(void) { return used_def_without_default_decl() + 
used_decl_without_default_decl(); }
----------------
labrinea wrote:

Hmm, your second example is interesting. We have stated in ACLE 
(https://github.com/ARM-software/acle/pull/310) that a declaration of a version 
should be visible to the TU where its definition resides. In this case only the 
default definition exists in the TU, so I believe rightfully we will generate a 
normal (unmangled) definition without the ".default" suffix for it.

https://github.com/llvm/llvm-project/pull/85454
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to