aboutsummaryrefslogtreecommitdiff
path: root/examples
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
parentd63ec6f20dc7e29e266589458ea90fb56f8c86ea (diff)
downloadtinycc-95b9a477b6743004e0e9bf728b25bf63d2908777.tar.gz
tinycc-95b9a477b6743004e0e9bf728b25bf63d2908777.tar.bz2
weak function symbols
Diffstat (limited to 'examples')
-rwxr-xr-xexamples/ex_weak.c11
-rw-r--r--examples/weak_f.c6
2 files changed, 17 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();
+ }
+}
diff --git a/examples/weak_f.c b/examples/weak_f.c
new file mode 100644
index 0000000..e744531
--- /dev/null
+++ b/examples/weak_f.c
@@ -0,0 +1,6 @@
+#include <tcclib.h>
+
+void weak_f (void)
+{
+ printf("Weak\n");
+}