aboutsummaryrefslogtreecommitdiff
path: root/examples/ex_weak.c
diff options
context:
space:
mode:
authorManuel Simoni <msimoni@gmail.com>2010-02-27 17:37:59 +0100
committerManuel Simoni <msimoni@gmail.com>2010-02-27 17:37:59 +0100
commit95b9a477b6743004e0e9bf728b25bf63d2908777 (patch)
treed5406d5ac0054dda4ddb5494ae58103f3d5c0930 /examples/ex_weak.c
parentd63ec6f20dc7e29e266589458ea90fb56f8c86ea (diff)
downloadtinycc-95b9a477b6743004e0e9bf728b25bf63d2908777.tar.gz
tinycc-95b9a477b6743004e0e9bf728b25bf63d2908777.tar.bz2
weak function symbols
Diffstat (limited to 'examples/ex_weak.c')
-rwxr-xr-xexamples/ex_weak.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/examples/ex_weak.c b/examples/ex_weak.c
new file mode 100755
index 0000000..2a2bd19
--- /dev/null
+++ b/examples/ex_weak.c
@@ -0,0 +1,11 @@
+#! /usr/local/bin/tcc -run
+#include <tcclib.h>
+
+extern void weak_f (void) __attribute__ ((weak));
+
+int main ()
+{
+ if (weak_f) {
+ weak_f();
+ }
+}