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`.
This commit is contained in:
Andrew Kelley
2021-08-04 23:02:13 -07:00
parent d4468affb7
commit f58cbef165
5 changed files with 75 additions and 47 deletions

View File

@@ -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"));
}