aboutsummaryrefslogtreecommitdiff
path: root/test/behavior/basic.zig
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2021-08-04 23:02:13 -0700
committerAndrew Kelley <andrew@ziglang.org>2021-08-04 23:02:13 -0700
commitf58cbef1659742e57377d3f8c92a0b9b97af91ad (patch)
tree43bc60f54b5a4252df309d9c3cb5dbe3aca20297 /test/behavior/basic.zig
parentd4468affb751668e156230c32b29c84684825b4f (diff)
downloadzig-f58cbef1659742e57377d3f8c92a0b9b97af91ad.tar.gz
zig-f58cbef1659742e57377d3f8c92a0b9b97af91ad.zip
stage2: std.mem.eql works now
* The `indexable_ptr_len` ZIR instruction now uses a `none_or_ref` ResultLoc. This prevents an unnecessary `ref` instruction from being emitted. * Sema: Fix `analyzeCall` using the incorrect ZIR object for the generic function callee. * LLVM backend: `genTypedValue` supports a `Slice` type encoded with the `decl_ref` `Value`.
Diffstat (limited to 'test/behavior/basic.zig')
-rw-r--r--test/behavior/basic.zig9
1 files changed, 9 insertions, 0 deletions
diff --git a/test/behavior/basic.zig b/test/behavior/basic.zig
index c5c2972ffc..ac1dc3889c 100644
--- a/test/behavior/basic.zig
+++ b/test/behavior/basic.zig
@@ -1,4 +1,5 @@
const std = @import("std");
+const mem = std.mem;
const expect = std.testing.expect;
// normal comment
@@ -83,3 +84,11 @@ test "unicode escape in character literal" {
test "unicode character in character literal" {
try expect('💩' == 128169);
}
+
+fn first4KeysOfHomeRow() []const u8 {
+ return "aoeu";
+}
+
+test "return string from function" {
+ try expect(mem.eql(u8, first4KeysOfHomeRow(), "aoeu"));
+}