aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorAndrew Kelley <superjoe30@gmail.com>2016-11-28 02:40:01 -0500
committerAndrew Kelley <superjoe30@gmail.com>2016-11-28 02:40:01 -0500
commiteb5693d91f7ff92b88c4a0dc3e5499dd0a700b34 (patch)
tree44d4d36dc5bc5ba9368119652d099aa70156efe9 /test
parent9e7c47597985a4a35912d2b1f800d3af05597a3a (diff)
downloadzig-eb5693d91f7ff92b88c4a0dc3e5499dd0a700b34.tar.gz
zig-eb5693d91f7ff92b88c4a0dc3e5499dd0a700b34.zip
IR: function call porting progress
also implemented container init generics is still todo
Diffstat (limited to 'test')
-rw-r--r--test/self_hosted2.zig13
1 files changed, 13 insertions, 0 deletions
diff --git a/test/self_hosted2.zig b/test/self_hosted2.zig
index 6b5d12ffd1..980e14d65c 100644
--- a/test/self_hosted2.zig
+++ b/test/self_hosted2.zig
@@ -84,6 +84,18 @@ end:
}
var goto_counter: i32 = 0;
+
+
+struct FooA {
+ fn add(a: i32, b: i32) -> i32 { a + b }
+}
+const foo_a = FooA {};
+
+fn testStructStatic() {
+ const result = FooA.add(3, 4);
+ assert(result == 7);
+}
+
fn assert(ok: bool) {
if (!ok)
@unreachable();
@@ -98,6 +110,7 @@ fn runAllTests() {
testInlineSwitch();
testNamespaceFnCall();
gotoAndLabels();
+ testStructStatic();
}
export nakedcc fn _start() -> unreachable {