aboutsummaryrefslogtreecommitdiff
path: root/tinycc/tests/tests2/113_btdll.c
diff options
context:
space:
mode:
authorUneven Prankster <unevenprankster@protonmail.com>2023-07-12 13:22:29 -0300
committerUneven Prankster <unevenprankster@protonmail.com>2023-07-12 13:22:29 -0300
commitfa2bdd711212ba6b7a94a20971e8bfa281e73296 (patch)
tree6713b3c0379507d49558287b71dd360ce188a2f0 /tinycc/tests/tests2/113_btdll.c
lol
Diffstat (limited to 'tinycc/tests/tests2/113_btdll.c')
-rw-r--r--tinycc/tests/tests2/113_btdll.c43
1 files changed, 43 insertions, 0 deletions
diff --git a/tinycc/tests/tests2/113_btdll.c b/tinycc/tests/tests2/113_btdll.c
new file mode 100644
index 0000000..8ae8981
--- /dev/null
+++ b/tinycc/tests/tests2/113_btdll.c
@@ -0,0 +1,43 @@
+int tcc_backtrace(const char*, ...);
+#define hello() \
+ tcc_backtrace("hello from %s() / %s:%d",__FUNCTION__,__FILE__,__LINE__)
+
+#ifndef _WIN32
+# define __declspec(n)
+#endif
+
+#if DLL==1
+__declspec(dllexport) int f_1()
+{
+ hello();
+ return 0;
+}
+
+
+#elif DLL==2
+__declspec(dllexport) int f_2()
+{
+ hello();
+ return 0;
+}
+
+
+#else
+
+int f_1();
+int f_2();
+int f_main()
+{
+ hello();
+ return 0;
+}
+
+int main ()
+{
+ f_1();
+ f_2();
+ f_main();
+ return 0;
+}
+
+#endif