================
@@ -59,15 +59,22 @@ int bar() {
   return m.goo(1) + foo(1) + foo();
 }
 
+// Example to demonstrate that at the point of use we haven't yet seen the 
default.
+// At that point a declaration for the unmangled symbol is emitted, which is 
later
+// replaced by the ifunc symbol (once we have seen the default definition).
+__attribute__((target_version("aes"))) void fmv(void) {}
+void caller(void) { fmv(); }
+__attribute__((target_version("default"))) void fmv(void) {}
----------------
labrinea wrote:

If we hadn't replaced the unmangled symbol, the compiler would assert because 
of type mismatch with the ifunc symbol:
```
Found return instr that returns non-void in Function of void return type!
  ret ptr @fmv._Maes
 voidFound return instr that returns non-void in Function of void return type!
  ret ptr @fmv.default
 voidfatal error: error in backend: Broken module found, compilation aborted!
 ```

When the versioned function is called but no resolver is emitted (if we comment 
out the default definition), we would like to see that a a declaration is 
emitted. However, I couldn't get the script `update_cc_test_checks.py` do that 
for me.

```
declare void @fmv()
```

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

Reply via email to