[compiler-rt] r286637 - [cfi] Test case for weak symbol handling.

Evgeniy Stepanov via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 11 13:39:36 PST 2016


Author: eugenis
Date: Fri Nov 11 15:39:35 2016
New Revision: 286637

URL: http://llvm.org/viewvc/llvm-project?rev=286637&view=rev
Log:
[cfi] Test case for weak symbol handling.

Added:
    compiler-rt/trunk/test/cfi/icall/weak.c

Added: compiler-rt/trunk/test/cfi/icall/weak.c
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/cfi/icall/weak.c?rev=286637&view=auto
==============================================================================
--- compiler-rt/trunk/test/cfi/icall/weak.c (added)
+++ compiler-rt/trunk/test/cfi/icall/weak.c Fri Nov 11 15:39:35 2016
@@ -0,0 +1,14 @@
+// Test that weak symbols stay weak.
+// RUN: %clang_cfi -lm -o %t1 %s && %t1
+
+__attribute__((weak)) void does_not_exist(void);
+
+__attribute__((noinline))
+void foo(void (*p)(void)) {
+  p();
+}
+
+int main(int argc, char **argv) {
+  if (does_not_exist)
+    foo(does_not_exist);
+}




More information about the llvm-commits mailing list