diff options
| author | Andrew Kelley <superjoe30@gmail.com> | 2016-12-10 17:11:35 -0500 |
|---|---|---|
| committer | Andrew Kelley <superjoe30@gmail.com> | 2016-12-10 17:11:35 -0500 |
| commit | 443e14afbd0615bd4902e53a31f70550a8d4497e (patch) | |
| tree | 1c166af90a15639f54dd9931972c32918a25b251 /test | |
| parent | 0ab953acb2b7192c5907a1c9d9ed9cf850530af2 (diff) | |
| download | zig-443e14afbd0615bd4902e53a31f70550a8d4497e.tar.gz zig-443e14afbd0615bd4902e53a31f70550a8d4497e.zip | |
IR: fix errorName builtin
Diffstat (limited to 'test')
| -rw-r--r-- | test/self_hosted2.zig | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/test/self_hosted2.zig b/test/self_hosted2.zig index 7bca89a206..a1f4aa2a14 100644 --- a/test/self_hosted2.zig +++ b/test/self_hosted2.zig @@ -258,6 +258,15 @@ pub fn sliceEql(inline T: type, a: []const T, b: []const T) -> bool { return true; } +error ItBroke; +fn gimmeItBroke() -> []const u8 { + @errorName(error.ItBroke) +} + +fn testErrorName() { + assert(memeql(@errorName(error.ItBroke), "ItBroke")); +} + fn assert(ok: bool) { if (!ok) @unreachable(); @@ -284,6 +293,7 @@ fn runAllTests() { testInlineVarsAgain(); testMinValueAndMaxValue(); testReturnStringFromFunction(); + testErrorName(); } export nakedcc fn _start() -> unreachable { |
