summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorNagi5Yeq <wu@x-nagi.com>2020-05-31 17:49:34 +0800
committerNagi5Yeq <wu@x-nagi.com>2020-05-31 17:49:34 +0800
commitc2c6e5c7e620c32e7f420e8b9ac21df8855b444c (patch)
treec790ec3650c2f6caed9b59b304bc6a8bbdef1da8 /t
parent4a5bc55769804d003d6cd9f8c16eefb76bb53d1b (diff)
support for extern functions
Diffstat (limited to 't')
-rw-r--r--t/extern.pas15
1 files changed, 15 insertions, 0 deletions
diff --git a/t/extern.pas b/t/extern.pas
new file mode 100644
index 0000000..0b78e45
--- /dev/null
+++ b/t/extern.pas
@@ -0,0 +1,15 @@
+program hello_world;
+
+extern puts(s:string):integer;
+extern printf(s:string, ...):integer;
+extern __isoc99_scanf(s:string, ...):integer;
+
+function main():integer;
+var
+ buf:array[0..1023] of char;
+begin
+ puts('Hello, World!');
+ printf('Variadic Function Test: %d, %s, %x\nsay something:', 1, 'yes', 0x12345678);
+ __isoc99_scanf('%s', @buf);
+ printf('you said: %s\n', @buf)
+end;