Mark test function as 'weak' to prevent interprocedural CSE.

A recent change to MemorySSA caused LLVM to start optimizing the call to
'f(x)' into just 'x', despite the 'noinline' attribute. So try harder to
prevent this optimization from firing.
This commit is contained in:
Richard Smith 2020-03-09 17:01:07 -07:00
parent 2669e41b7b
commit 51fab8f36f
1 changed files with 1 additions and 0 deletions

View File

@ -9,6 +9,7 @@
#include <stdio.h>
__attribute__((noinline))
__attribute__((weak))
__attribute__((no_sanitize_memory))
int f(int x) {
return x;