aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/self_hosted2.zig10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/self_hosted2.zig b/test/self_hosted2.zig
index 51fabdcdac..efa02ab948 100644
--- a/test/self_hosted2.zig
+++ b/test/self_hosted2.zig
@@ -194,6 +194,15 @@ entry:
if (b) goto exit;
}
+fn unwrapAndAddOne(blah: ?i32) -> i32 {
+ return ??blah + 1;
+}
+
+const should_be_1235 = unwrapAndAddOne(1234);
+
+fn testStaticAddOne() {
+ assert(should_be_1235 == 1235);
+}
fn assert(ok: bool) {
@@ -218,6 +227,7 @@ fn runAllTests() {
testContinueInForLoop();
shortCircuit();
testGotoLeaveDeferScope(true);
+ testStaticAddOne();
}
export nakedcc fn _start() -> unreachable {