diff options
| author | Jimmi Holst Christensen <jimmiholstchristensen@gmail.com> | 2018-06-30 18:58:31 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-06-30 18:58:31 +0200 |
| commit | 42033ea3ca126ff1f3e5555ba56cc5a7adeb3d6b (patch) | |
| tree | abb5b4bf1267f3902dd9d128b225bc3a7e9607f3 /test/cases/array.zig | |
| parent | 3f4b77f56132131e72b3fded52d2bcb71f8f5582 (diff) | |
| parent | 01bd5c46e177ae59f72197063c374e845eea3ff3 (diff) | |
| download | zig-42033ea3ca126ff1f3e5555ba56cc5a7adeb3d6b.tar.gz zig-42033ea3ca126ff1f3e5555ba56cc5a7adeb3d6b.zip | |
Merge pull request #1167 from ziglang/comptime-array-by-value
Implement const_values_equal for arrays
Diffstat (limited to 'test/cases/array.zig')
| -rw-r--r-- | test/cases/array.zig | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/test/cases/array.zig b/test/cases/array.zig index b481261b4f..b72491bcc0 100644 --- a/test/cases/array.zig +++ b/test/cases/array.zig @@ -152,3 +152,11 @@ fn testImplicitCastSingleItemPtr() void { slice[0] += 1; assert(byte == 101); } + +fn testArrayByValAtComptime(b: [2]u8) u8 { return b[0]; } + +test "comptime evalutating function that takes array by value" { + const arr = []u8{0,1}; + _ = comptime testArrayByValAtComptime(arr); + _ = comptime testArrayByValAtComptime(arr); +} |
