summaryrefslogtreecommitdiff
path: root/testsuite/tests/cps/cps003.cmm
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite/tests/cps/cps003.cmm')
-rw-r--r--testsuite/tests/cps/cps003.cmm15
1 files changed, 15 insertions, 0 deletions
diff --git a/testsuite/tests/cps/cps003.cmm b/testsuite/tests/cps/cps003.cmm
new file mode 100644
index 0000000000..dba506f9d3
--- /dev/null
+++ b/testsuite/tests/cps/cps003.cmm
@@ -0,0 +1,15 @@
+// Basic function with a heap check
+// The GC block should only be one instruction
+// (or rather it should be after assignment optimizations)
+
+foo1 {
+ bits32 r;
+ B:
+ (r) = foreign "C--" bar() "safe";
+ L:
+ if (Hp > HpLim) {
+ (r) = foreign "C--" stg_gc_ret_p(r) "safe";
+ goto L;
+ }
+ return (r);
+}