xref: /llvm-project/compiler-rt/test/cfi/icall/weak.c (revision 8f21c0e50acb2d81deff8ac8380268f58fb3a77b)
1 // Test that weak symbols stay weak.
2 // RUN: %clang_cfi -lm -o %t1 %s && %t1
3 // XFAIL: darwin
4 
5 __attribute__((weak)) void does_not_exist(void);
6 
7 __attribute__((noinline))
foo(void (* p)(void))8 void foo(void (*p)(void)) {
9   p();
10 }
11 
main(int argc,char ** argv)12 int main(int argc, char **argv) {
13   if (does_not_exist)
14     foo(does_not_exist);
15 }
16