summaryrefslogtreecommitdiff
path: root/test/abi/001_main.myr
diff options
context:
space:
mode:
authorS. Gilles <sgilles@umd.edu>2020-06-20 21:55:49 -0400
committerS. Gilles <sgilles@umd.edu>2020-06-24 13:24:41 -0400
commitd68cb921e334d6fd802d6ae93398d6324cb784ff (patch)
treefffb7f31928d130712e58b38c232244abd0ba81e /test/abi/001_main.myr
parent2b398fd1053b03888f400011dda46d4e36986876 (diff)
downloadmc-d68cb921e334d6fd802d6ae93398d6324cb784ff.tar.gz
Add tests for abi conformity.
Tests 001 through 003 are specific errors, and 004 through 006 are batches of blanket fuzzing that uncovered at least one error each. The blanket fuzzers test function calls between all combinations of {myrddin, c} and {myrddin, c}, except for c functions calling c functions.
Diffstat (limited to 'test/abi/001_main.myr')
-rw-r--r--test/abi/001_main.myr29
1 files changed, 29 insertions, 0 deletions
diff --git a/test/abi/001_main.myr b/test/abi/001_main.myr
new file mode 100644
index 0000000..fcdc78a
--- /dev/null
+++ b/test/abi/001_main.myr
@@ -0,0 +1,29 @@
+use std
+use "001_types"
+use "001_in-myr"
+use "001_in-c"
+
+const main = {
+ /* myr calling myr */
+ var ret_1 : t1 = fn_1_myr()
+ if !(((ret_1.field_1.0==249229305184256) && (ret_1.field_1.1==3.36328125)))
+ std.put("ret_1 = {}\n", ret_1)
+ std.put("myr_to_myr 1 failed\n")
+ std.exit(1)
+ ;;
+
+ /* myr calling c */
+ ret_1 = fn_1_c()
+ if !(((ret_1.field_1.0==249229305184256) && (ret_1.field_1.1==3.36328125)))
+ std.put("ret_1 = {}\n", ret_1)
+ std.put("myr_to_c 1 failed\n")
+ std.exit(1)
+ ;;
+
+ if !(check_c_to_myr_fns() == 0)
+ std.put("c_to_myr failed\n")
+ std.exit(1)
+ ;;
+
+ std.exit(0)
+}