From 78cf00cb506cb86112cb715e4d2d69ec11b20c42 Mon Sep 17 00:00:00 2001 From: Kimplul Date: Mon, 27 Mar 2023 03:18:48 +0300 Subject: change typeof to be a full time type --- tests/callbacks.cu | 17 +++++++++++++++++ tests/calls.cu | 19 +++++++++++++++++++ tests/loops.cu | 4 ++++ 3 files changed, 40 insertions(+) create mode 100644 tests/callbacks.cu create mode 100644 tests/calls.cu create mode 100644 tests/loops.cu (limited to 'tests') diff --git a/tests/callbacks.cu b/tests/callbacks.cu new file mode 100644 index 0000000..0249065 --- /dev/null +++ b/tests/callbacks.cu @@ -0,0 +1,17 @@ +do_stuff(proc '(u32)) +{ + proc(); +} + +other_proc(u32) +{ +} + +other_proc() +{ +} + +main() +{ + do_stuff(other_proc as '(u32)); +} diff --git a/tests/calls.cu b/tests/calls.cu new file mode 100644 index 0000000..4978649 --- /dev/null +++ b/tests/calls.cu @@ -0,0 +1,19 @@ +typedef some_type { + add(some_type, some_type => some_type); +} + +add(a u32, b u32 => u32) +{ + return a + b; +} + +/* ah fuck, analyze_proc gobbles up the typeof */ +some_proc(a some_type, b typeof a => typeof a) +{ + return add(a, b); +} + +main() +{ + some_proc(20 as u32, 40 as u32); +} diff --git a/tests/loops.cu b/tests/loops.cu new file mode 100644 index 0000000..5b6f702 --- /dev/null +++ b/tests/loops.cu @@ -0,0 +1,4 @@ +/* this should error out with some decent message about type loops or something + * */ +f(=>typeof main()){} +main(=> typeof f()){} -- cgit v1.3