aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorAndrew Kelley <superjoe30@gmail.com>2016-12-26 03:16:19 -0500
committerAndrew Kelley <superjoe30@gmail.com>2016-12-26 03:16:19 -0500
commit73a751911e2c2be646287eb8c8d579dded25afe3 (patch)
tree77d14408a8eb895878baa9678ee714dfa03497b7 /test
parent6ed835ca67670098da79d4e329c6efcb12419599 (diff)
downloadzig-73a751911e2c2be646287eb8c8d579dded25afe3.tar.gz
zig-73a751911e2c2be646287eb8c8d579dded25afe3.zip
IR: pass staticEvalListInit test
Diffstat (limited to 'test')
-rw-r--r--test/cases/eval.zig15
-rw-r--r--test/self_hosted.zig14
2 files changed, 15 insertions, 14 deletions
diff --git a/test/cases/eval.zig b/test/cases/eval.zig
index c34d552035..8f5b18f529 100644
--- a/test/cases/eval.zig
+++ b/test/cases/eval.zig
@@ -94,6 +94,21 @@ fn makePoint(x: i32, y: i32) -> Point {
}
+fn staticEvalListInit() {
+ @setFnTest(this);
+
+ assert(static_vec3.data[2] == 1.0);
+ assert(vec3(0.0, 0.0, 3.0).data[2] == 3.0);
+}
+const static_vec3 = vec3(0.0, 0.0, 1.0);
+pub const Vec3 = struct {
+ data: [3]f32,
+};
+pub fn vec3(x: f32, y: f32, z: f32) -> Vec3 {
+ Vec3 {
+ .data = []f32 { x, y, z, },
+ }
+}
// TODO const assert = @import("std").debug.assert;
fn assert(ok: bool) {
diff --git a/test/self_hosted.zig b/test/self_hosted.zig
index 4c6c9641bc..d78eace9d1 100644
--- a/test/self_hosted.zig
+++ b/test/self_hosted.zig
@@ -4,20 +4,6 @@ const str = std.str;
const cstr = std.cstr;
-fn staticEvalListInit() {
- @setFnTest(this);
-
- assert(static_vec3.data[2] == 1.0);
-}
-const static_vec3 = vec3(0.0, 0.0, 1.0);
-pub const Vec3 = struct {
- data: [3]f32,
-};
-pub fn vec3(x: f32, y: f32, z: f32) -> Vec3 {
- Vec3 {
- .data = []f32 { x, y, z, },
- }
-}
fn genericFnWithImplicitCast() {
@setFnTest(this, true);