summaryrefslogtreecommitdiff
path: root/t/bad.pas
diff options
context:
space:
mode:
authorNagi5Yeq <wu@x-nagi.com>2020-06-21 16:00:07 +0800
committerNagi5Yeq <wu@x-nagi.com>2020-06-21 16:00:07 +0800
commit50c71fdd495b74e812f0e2a1af87e932a8aa9ade (patch)
tree4db5e64a09ad5160caf65fe397e45204d72d335f /t/bad.pas
parent07c2f96ae65f962150610cd9dad35da0ed88ce04 (diff)
add error handlingHEADmaster
Diffstat (limited to 't/bad.pas')
-rw-r--r--t/bad.pas26
1 files changed, 26 insertions, 0 deletions
diff --git a/t/bad.pas b/t/bad.pas
new file mode 100644
index 0000000..3bc25ef
--- /dev/null
+++ b/t/bad.pas
@@ -0,0 +1,26 @@
+program hello_world;
+
+extern Pascal_puts(s:string):integer;
+extern Pascal_printf(s:string; ...):integer;
+extern Pascal_scanf(s:string; ...):integer;
+
+function main():integer;
+var
+ buf:array[0..1023] of char;
+ i:integer;
+begin
+ Pascal_puts(;
+ (;
+ i+;
+ i:=3+;
+ Pascal_puts('Hello, World!');
+ Pascal_printf('Variadic Function Test: %d, %s, %llx\n', 1, 'yes', 0x123456789abcd);
+ for i:=0 to 10 do
+ begin
+ if i=3 then continue;
+ if i=5 then break;
+ Pascal_printf('say something: ');
+ Pascal_scanf('%s', @buf[0]);
+ Pascal_printf('round %d you said: %s\n', i, @buf[0])
+ end;
+end;