aboutsummaryrefslogtreecommitdiff
path: root/test/behavior/bugs/13069.zig
blob: 916f3ba8002e03978ca8eea31dfb4d0d83253625 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
const std = @import("std");
const builtin = @import("builtin");
const expect = std.testing.expect;

test {
    if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
    if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO
    if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
    if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest;

    var opt_x: ?[3]f32 = [_]f32{0.0} ** 3;

    const x = opt_x.?;
    opt_x.?[0] = 15.0;

    try expect(x[0] == 0.0);
}