2019-05-27 17:07:05 -07:00
|
|
|
const std = @import("std");
|
|
|
|
const os = std.os;
|
|
|
|
const tests = @import("tests.zig");
|
|
|
|
|
2020-02-22 09:02:55 -08:00
|
|
|
// zig fmt: off
|
2019-09-03 07:08:39 -07:00
|
|
|
pub fn addCases(cases: *tests.StackTracesContext) void {
|
2019-05-27 17:07:05 -07:00
|
|
|
const source_return =
|
|
|
|
\\const std = @import("std");
|
|
|
|
\\
|
|
|
|
\\pub fn main() !void {
|
|
|
|
\\ return error.TheSkyIsFalling;
|
|
|
|
\\}
|
|
|
|
;
|
|
|
|
const source_try_return =
|
|
|
|
\\const std = @import("std");
|
|
|
|
\\
|
|
|
|
\\fn foo() !void {
|
|
|
|
\\ return error.TheSkyIsFalling;
|
|
|
|
\\}
|
|
|
|
\\
|
|
|
|
\\pub fn main() !void {
|
|
|
|
\\ try foo();
|
|
|
|
\\}
|
|
|
|
;
|
|
|
|
const source_try_try_return_return =
|
|
|
|
\\const std = @import("std");
|
|
|
|
\\
|
|
|
|
\\fn foo() !void {
|
|
|
|
\\ try bar();
|
|
|
|
\\}
|
|
|
|
\\
|
|
|
|
\\fn bar() !void {
|
|
|
|
\\ return make_error();
|
|
|
|
\\}
|
|
|
|
\\
|
|
|
|
\\fn make_error() !void {
|
|
|
|
\\ return error.TheSkyIsFalling;
|
|
|
|
\\}
|
|
|
|
\\
|
|
|
|
\\pub fn main() !void {
|
|
|
|
\\ try foo();
|
|
|
|
\\}
|
|
|
|
;
|
2020-02-22 09:02:55 -08:00
|
|
|
|
2020-02-07 08:08:21 -08:00
|
|
|
const source_dumpCurrentStackTrace =
|
|
|
|
\\const std = @import("std");
|
|
|
|
\\
|
|
|
|
\\fn bar() void {
|
|
|
|
\\ std.debug.dumpCurrentStackTrace(@returnAddress());
|
|
|
|
\\}
|
|
|
|
\\fn foo() void {
|
|
|
|
\\ bar();
|
|
|
|
\\}
|
|
|
|
\\pub fn main() u8 {
|
|
|
|
\\ foo();
|
|
|
|
\\ return 1;
|
|
|
|
\\}
|
|
|
|
;
|
|
|
|
|
2020-02-26 12:35:48 -08:00
|
|
|
switch (std.Target.current.os.tag) {
|
2019-09-07 20:04:01 -07:00
|
|
|
.freebsd => {
|
|
|
|
cases.addCase(
|
|
|
|
"return",
|
|
|
|
source_return,
|
|
|
|
[_][]const u8{
|
|
|
|
// debug
|
2020-02-07 08:08:21 -08:00
|
|
|
\\error: TheSkyIsFalling
|
2019-09-07 20:04:01 -07:00
|
|
|
\\source.zig:4:5: [address] in main (test)
|
2020-01-21 13:58:51 -08:00
|
|
|
\\ return error.TheSkyIsFalling;
|
|
|
|
\\ ^
|
2019-09-07 20:04:01 -07:00
|
|
|
\\
|
|
|
|
,
|
|
|
|
// release-safe
|
2020-02-07 08:08:21 -08:00
|
|
|
\\error: TheSkyIsFalling
|
2019-12-12 16:43:04 -08:00
|
|
|
\\source.zig:4:5: [address] in std.start.main (test)
|
2020-01-21 13:58:51 -08:00
|
|
|
\\ return error.TheSkyIsFalling;
|
|
|
|
\\ ^
|
2019-09-07 20:04:01 -07:00
|
|
|
\\
|
|
|
|
,
|
|
|
|
// release-fast
|
2020-02-07 08:08:21 -08:00
|
|
|
\\error: TheSkyIsFalling
|
2019-09-07 20:04:01 -07:00
|
|
|
\\
|
|
|
|
,
|
|
|
|
// release-small
|
2020-02-07 08:08:21 -08:00
|
|
|
\\error: TheSkyIsFalling
|
2019-09-07 20:04:01 -07:00
|
|
|
\\
|
|
|
|
},
|
|
|
|
);
|
|
|
|
cases.addCase(
|
|
|
|
"try return",
|
|
|
|
source_try_return,
|
|
|
|
[_][]const u8{
|
|
|
|
// debug
|
2020-02-07 08:08:21 -08:00
|
|
|
\\error: TheSkyIsFalling
|
2019-09-07 20:04:01 -07:00
|
|
|
\\source.zig:4:5: [address] in foo (test)
|
2020-01-21 13:58:51 -08:00
|
|
|
\\ return error.TheSkyIsFalling;
|
|
|
|
\\ ^
|
2019-09-07 20:04:01 -07:00
|
|
|
\\source.zig:8:5: [address] in main (test)
|
2020-01-21 13:58:51 -08:00
|
|
|
\\ try foo();
|
|
|
|
\\ ^
|
2019-09-07 20:04:01 -07:00
|
|
|
\\
|
|
|
|
,
|
|
|
|
// release-safe
|
2020-02-07 08:08:21 -08:00
|
|
|
\\error: TheSkyIsFalling
|
2019-12-12 16:43:04 -08:00
|
|
|
\\source.zig:4:5: [address] in std.start.main (test)
|
2020-01-21 13:58:51 -08:00
|
|
|
\\ return error.TheSkyIsFalling;
|
|
|
|
\\ ^
|
2019-12-12 16:43:04 -08:00
|
|
|
\\source.zig:8:5: [address] in std.start.main (test)
|
2020-01-21 13:58:51 -08:00
|
|
|
\\ try foo();
|
|
|
|
\\ ^
|
2019-09-07 20:04:01 -07:00
|
|
|
\\
|
|
|
|
,
|
|
|
|
// release-fast
|
2020-02-07 08:08:21 -08:00
|
|
|
\\error: TheSkyIsFalling
|
2019-09-07 20:04:01 -07:00
|
|
|
\\
|
|
|
|
,
|
|
|
|
// release-small
|
2020-02-07 08:08:21 -08:00
|
|
|
\\error: TheSkyIsFalling
|
2019-09-07 20:04:01 -07:00
|
|
|
\\
|
|
|
|
},
|
|
|
|
);
|
|
|
|
cases.addCase(
|
|
|
|
"try try return return",
|
|
|
|
source_try_try_return_return,
|
|
|
|
[_][]const u8{
|
|
|
|
// debug
|
2020-02-07 08:08:21 -08:00
|
|
|
\\error: TheSkyIsFalling
|
2019-09-07 20:04:01 -07:00
|
|
|
\\source.zig:12:5: [address] in make_error (test)
|
2020-01-21 13:58:51 -08:00
|
|
|
\\ return error.TheSkyIsFalling;
|
|
|
|
\\ ^
|
2019-09-07 20:04:01 -07:00
|
|
|
\\source.zig:8:5: [address] in bar (test)
|
2020-01-21 13:58:51 -08:00
|
|
|
\\ return make_error();
|
|
|
|
\\ ^
|
2019-09-07 20:04:01 -07:00
|
|
|
\\source.zig:4:5: [address] in foo (test)
|
2020-01-21 13:58:51 -08:00
|
|
|
\\ try bar();
|
|
|
|
\\ ^
|
2019-09-07 20:04:01 -07:00
|
|
|
\\source.zig:16:5: [address] in main (test)
|
2020-01-21 13:58:51 -08:00
|
|
|
\\ try foo();
|
|
|
|
\\ ^
|
2019-09-07 20:04:01 -07:00
|
|
|
\\
|
|
|
|
,
|
|
|
|
// release-safe
|
2020-02-07 08:08:21 -08:00
|
|
|
\\error: TheSkyIsFalling
|
2019-12-12 16:43:04 -08:00
|
|
|
\\source.zig:12:5: [address] in std.start.main (test)
|
2020-01-21 13:58:51 -08:00
|
|
|
\\ return error.TheSkyIsFalling;
|
|
|
|
\\ ^
|
2019-12-12 16:43:04 -08:00
|
|
|
\\source.zig:8:5: [address] in std.start.main (test)
|
2020-01-21 13:58:51 -08:00
|
|
|
\\ return make_error();
|
|
|
|
\\ ^
|
2019-12-12 16:43:04 -08:00
|
|
|
\\source.zig:4:5: [address] in std.start.main (test)
|
2020-01-21 13:58:51 -08:00
|
|
|
\\ try bar();
|
|
|
|
\\ ^
|
2019-12-12 16:43:04 -08:00
|
|
|
\\source.zig:16:5: [address] in std.start.main (test)
|
2020-01-21 13:58:51 -08:00
|
|
|
\\ try foo();
|
|
|
|
\\ ^
|
2019-09-07 20:04:01 -07:00
|
|
|
\\
|
|
|
|
,
|
|
|
|
// release-fast
|
2020-02-07 08:08:21 -08:00
|
|
|
\\error: TheSkyIsFalling
|
2019-09-07 20:04:01 -07:00
|
|
|
\\
|
|
|
|
,
|
|
|
|
// release-small
|
2020-02-07 08:08:21 -08:00
|
|
|
\\error: TheSkyIsFalling
|
2019-09-07 20:04:01 -07:00
|
|
|
\\
|
|
|
|
},
|
|
|
|
);
|
|
|
|
},
|
2019-05-27 17:07:05 -07:00
|
|
|
.linux => {
|
|
|
|
cases.addCase(
|
|
|
|
"return",
|
|
|
|
source_return,
|
2019-09-03 07:05:19 -07:00
|
|
|
[_][]const u8{
|
|
|
|
// debug
|
2020-02-07 08:08:21 -08:00
|
|
|
\\error: TheSkyIsFalling
|
2019-05-27 17:07:05 -07:00
|
|
|
\\source.zig:4:5: [address] in main (test)
|
2020-01-21 13:58:51 -08:00
|
|
|
\\ return error.TheSkyIsFalling;
|
|
|
|
\\ ^
|
2019-05-27 17:07:05 -07:00
|
|
|
\\
|
|
|
|
,
|
2019-09-03 07:05:19 -07:00
|
|
|
// release-safe
|
2020-02-07 08:08:21 -08:00
|
|
|
\\error: TheSkyIsFalling
|
2019-12-12 16:43:04 -08:00
|
|
|
\\source.zig:4:5: [address] in std.start.posixCallMainAndExit (test)
|
2020-01-21 13:58:51 -08:00
|
|
|
\\ return error.TheSkyIsFalling;
|
|
|
|
\\ ^
|
2019-05-27 17:07:05 -07:00
|
|
|
\\
|
|
|
|
,
|
2019-09-03 07:05:19 -07:00
|
|
|
// release-fast
|
2020-02-07 08:08:21 -08:00
|
|
|
\\error: TheSkyIsFalling
|
2019-05-27 17:07:05 -07:00
|
|
|
\\
|
|
|
|
,
|
2019-09-03 07:05:19 -07:00
|
|
|
// release-small
|
2020-02-07 08:08:21 -08:00
|
|
|
\\error: TheSkyIsFalling
|
2019-05-27 17:07:05 -07:00
|
|
|
\\
|
|
|
|
},
|
|
|
|
);
|
|
|
|
cases.addCase(
|
|
|
|
"try return",
|
|
|
|
source_try_return,
|
2019-09-03 07:05:19 -07:00
|
|
|
[_][]const u8{
|
|
|
|
// debug
|
2020-02-07 08:08:21 -08:00
|
|
|
\\error: TheSkyIsFalling
|
2019-05-27 17:07:05 -07:00
|
|
|
\\source.zig:4:5: [address] in foo (test)
|
2020-01-21 13:58:51 -08:00
|
|
|
\\ return error.TheSkyIsFalling;
|
|
|
|
\\ ^
|
2019-05-27 17:07:05 -07:00
|
|
|
\\source.zig:8:5: [address] in main (test)
|
2020-01-21 13:58:51 -08:00
|
|
|
\\ try foo();
|
|
|
|
\\ ^
|
2019-05-27 17:07:05 -07:00
|
|
|
\\
|
|
|
|
,
|
2019-09-03 07:05:19 -07:00
|
|
|
// release-safe
|
2020-02-07 08:08:21 -08:00
|
|
|
\\error: TheSkyIsFalling
|
2019-12-12 16:43:04 -08:00
|
|
|
\\source.zig:4:5: [address] in std.start.posixCallMainAndExit (test)
|
2020-01-21 13:58:51 -08:00
|
|
|
\\ return error.TheSkyIsFalling;
|
|
|
|
\\ ^
|
2019-12-12 16:43:04 -08:00
|
|
|
\\source.zig:8:5: [address] in std.start.posixCallMainAndExit (test)
|
2020-01-21 13:58:51 -08:00
|
|
|
\\ try foo();
|
|
|
|
\\ ^
|
2019-05-27 17:07:05 -07:00
|
|
|
\\
|
|
|
|
,
|
2019-09-03 07:05:19 -07:00
|
|
|
// release-fast
|
2020-02-07 08:08:21 -08:00
|
|
|
\\error: TheSkyIsFalling
|
2019-05-27 17:07:05 -07:00
|
|
|
\\
|
|
|
|
,
|
2019-09-03 07:05:19 -07:00
|
|
|
// release-small
|
2020-02-07 08:08:21 -08:00
|
|
|
\\error: TheSkyIsFalling
|
2019-05-27 17:07:05 -07:00
|
|
|
\\
|
|
|
|
},
|
|
|
|
);
|
|
|
|
cases.addCase(
|
|
|
|
"try try return return",
|
|
|
|
source_try_try_return_return,
|
2019-09-03 07:05:19 -07:00
|
|
|
[_][]const u8{
|
|
|
|
// debug
|
2020-02-07 08:08:21 -08:00
|
|
|
\\error: TheSkyIsFalling
|
2019-05-27 17:07:05 -07:00
|
|
|
\\source.zig:12:5: [address] in make_error (test)
|
2020-01-21 13:58:51 -08:00
|
|
|
\\ return error.TheSkyIsFalling;
|
|
|
|
\\ ^
|
2019-05-27 17:07:05 -07:00
|
|
|
\\source.zig:8:5: [address] in bar (test)
|
2020-01-21 13:58:51 -08:00
|
|
|
\\ return make_error();
|
|
|
|
\\ ^
|
2019-05-27 17:07:05 -07:00
|
|
|
\\source.zig:4:5: [address] in foo (test)
|
2020-01-21 13:58:51 -08:00
|
|
|
\\ try bar();
|
|
|
|
\\ ^
|
2019-05-27 17:07:05 -07:00
|
|
|
\\source.zig:16:5: [address] in main (test)
|
2020-01-21 13:58:51 -08:00
|
|
|
\\ try foo();
|
|
|
|
\\ ^
|
2019-05-27 17:07:05 -07:00
|
|
|
\\
|
|
|
|
,
|
2019-09-03 07:05:19 -07:00
|
|
|
// release-safe
|
2020-02-07 08:08:21 -08:00
|
|
|
\\error: TheSkyIsFalling
|
2019-12-12 16:43:04 -08:00
|
|
|
\\source.zig:12:5: [address] in std.start.posixCallMainAndExit (test)
|
2020-01-21 13:58:51 -08:00
|
|
|
\\ return error.TheSkyIsFalling;
|
|
|
|
\\ ^
|
2019-12-12 16:43:04 -08:00
|
|
|
\\source.zig:8:5: [address] in std.start.posixCallMainAndExit (test)
|
2020-01-21 13:58:51 -08:00
|
|
|
\\ return make_error();
|
|
|
|
\\ ^
|
2019-12-12 16:43:04 -08:00
|
|
|
\\source.zig:4:5: [address] in std.start.posixCallMainAndExit (test)
|
2020-01-21 13:58:51 -08:00
|
|
|
\\ try bar();
|
|
|
|
\\ ^
|
2019-12-12 16:43:04 -08:00
|
|
|
\\source.zig:16:5: [address] in std.start.posixCallMainAndExit (test)
|
2020-01-21 13:58:51 -08:00
|
|
|
\\ try foo();
|
|
|
|
\\ ^
|
2019-05-27 17:07:05 -07:00
|
|
|
\\
|
|
|
|
,
|
2019-09-03 07:05:19 -07:00
|
|
|
// release-fast
|
2020-02-07 08:08:21 -08:00
|
|
|
\\error: TheSkyIsFalling
|
2019-05-27 17:07:05 -07:00
|
|
|
\\
|
|
|
|
,
|
2019-09-03 07:05:19 -07:00
|
|
|
// release-small
|
2020-02-07 08:08:21 -08:00
|
|
|
\\error: TheSkyIsFalling
|
2019-05-27 17:07:05 -07:00
|
|
|
\\
|
|
|
|
},
|
|
|
|
);
|
2020-02-07 08:08:21 -08:00
|
|
|
cases.addCase(
|
|
|
|
"dumpCurrentStackTrace",
|
|
|
|
source_dumpCurrentStackTrace,
|
|
|
|
[_][]const u8{
|
|
|
|
// debug
|
|
|
|
\\source.zig:7:8: [address] in foo (test)
|
|
|
|
\\ bar();
|
|
|
|
\\ ^
|
|
|
|
\\source.zig:10:8: [address] in main (test)
|
|
|
|
\\ foo();
|
|
|
|
\\ ^
|
2020-03-25 04:08:50 -07:00
|
|
|
\\start.zig:250:29: [address] in std.start.posixCallMainAndExit (test)
|
2020-02-07 08:08:21 -08:00
|
|
|
\\ return root.main();
|
|
|
|
\\ ^
|
2020-03-22 14:07:24 -07:00
|
|
|
\\start.zig:123:5: [address] in std.start._start (test)
|
2020-02-07 08:08:21 -08:00
|
|
|
\\ @call(.{ .modifier = .never_inline }, posixCallMainAndExit, .{});
|
|
|
|
\\ ^
|
|
|
|
\\
|
|
|
|
,
|
|
|
|
// release-safe
|
2020-03-22 15:54:19 -07:00
|
|
|
switch (std.Target.current.cpu.arch) {
|
|
|
|
.aarch64 => "", // TODO disabled; results in segfault
|
|
|
|
else =>
|
2020-03-22 14:07:24 -07:00
|
|
|
\\start.zig:123:5: [address] in std.start._start (test)
|
2020-02-07 08:08:21 -08:00
|
|
|
\\ @call(.{ .modifier = .never_inline }, posixCallMainAndExit, .{});
|
|
|
|
\\ ^
|
|
|
|
\\
|
2020-03-22 15:54:19 -07:00
|
|
|
,
|
|
|
|
},
|
2020-02-07 08:08:21 -08:00
|
|
|
// release-fast
|
|
|
|
\\
|
|
|
|
,
|
|
|
|
// release-small
|
|
|
|
\\
|
|
|
|
},
|
|
|
|
);
|
2019-05-27 17:07:05 -07:00
|
|
|
},
|
|
|
|
.macosx => {
|
|
|
|
cases.addCase(
|
|
|
|
"return",
|
|
|
|
source_return,
|
2019-09-03 07:05:19 -07:00
|
|
|
[_][]const u8{
|
|
|
|
// debug
|
2019-09-07 20:04:01 -07:00
|
|
|
\\error: TheSkyIsFalling
|
2020-02-22 09:02:55 -08:00
|
|
|
\\source.zig:4:5: [address] in main (test)
|
2020-01-21 13:58:51 -08:00
|
|
|
\\ return error.TheSkyIsFalling;
|
|
|
|
\\ ^
|
2019-05-27 17:07:05 -07:00
|
|
|
\\
|
|
|
|
,
|
2019-09-03 07:05:19 -07:00
|
|
|
// release-safe
|
2019-09-07 20:04:01 -07:00
|
|
|
\\error: TheSkyIsFalling
|
2020-02-22 09:02:55 -08:00
|
|
|
\\source.zig:4:5: [address] in std.start.main (test)
|
2020-01-21 13:58:51 -08:00
|
|
|
\\ return error.TheSkyIsFalling;
|
|
|
|
\\ ^
|
2019-05-27 17:07:05 -07:00
|
|
|
\\
|
|
|
|
,
|
2019-09-03 07:05:19 -07:00
|
|
|
// release-fast
|
2020-02-07 08:08:21 -08:00
|
|
|
\\error: TheSkyIsFalling
|
2019-05-27 17:07:05 -07:00
|
|
|
\\
|
|
|
|
,
|
2019-09-03 07:05:19 -07:00
|
|
|
// release-small
|
2020-02-07 08:08:21 -08:00
|
|
|
\\error: TheSkyIsFalling
|
2019-05-27 17:07:05 -07:00
|
|
|
\\
|
|
|
|
},
|
|
|
|
);
|
|
|
|
cases.addCase(
|
|
|
|
"try return",
|
|
|
|
source_try_return,
|
2019-09-03 07:05:19 -07:00
|
|
|
[_][]const u8{
|
|
|
|
// debug
|
2019-09-07 20:04:01 -07:00
|
|
|
\\error: TheSkyIsFalling
|
2020-02-22 09:02:55 -08:00
|
|
|
\\source.zig:4:5: [address] in foo (test)
|
2020-01-21 13:58:51 -08:00
|
|
|
\\ return error.TheSkyIsFalling;
|
|
|
|
\\ ^
|
2020-02-22 09:02:55 -08:00
|
|
|
\\source.zig:8:5: [address] in main (test)
|
2020-01-21 13:58:51 -08:00
|
|
|
\\ try foo();
|
|
|
|
\\ ^
|
2019-05-27 17:07:05 -07:00
|
|
|
\\
|
|
|
|
,
|
2019-09-03 07:05:19 -07:00
|
|
|
// release-safe
|
2019-09-07 20:04:01 -07:00
|
|
|
\\error: TheSkyIsFalling
|
2020-02-22 09:02:55 -08:00
|
|
|
\\source.zig:4:5: [address] in std.start.main (test)
|
2020-01-21 13:58:51 -08:00
|
|
|
\\ return error.TheSkyIsFalling;
|
|
|
|
\\ ^
|
2020-02-22 09:02:55 -08:00
|
|
|
\\source.zig:8:5: [address] in std.start.main (test)
|
2020-01-21 13:58:51 -08:00
|
|
|
\\ try foo();
|
|
|
|
\\ ^
|
2019-05-27 17:07:05 -07:00
|
|
|
\\
|
|
|
|
,
|
2019-09-03 07:05:19 -07:00
|
|
|
// release-fast
|
2020-02-07 08:08:21 -08:00
|
|
|
\\error: TheSkyIsFalling
|
2019-05-27 17:07:05 -07:00
|
|
|
\\
|
|
|
|
,
|
2019-09-03 07:05:19 -07:00
|
|
|
// release-small
|
2020-02-07 08:08:21 -08:00
|
|
|
\\error: TheSkyIsFalling
|
2019-05-27 17:07:05 -07:00
|
|
|
\\
|
|
|
|
},
|
|
|
|
);
|
|
|
|
cases.addCase(
|
|
|
|
"try try return return",
|
|
|
|
source_try_try_return_return,
|
2019-09-03 07:05:19 -07:00
|
|
|
[_][]const u8{
|
|
|
|
// debug
|
2019-09-07 20:04:01 -07:00
|
|
|
\\error: TheSkyIsFalling
|
2020-02-22 09:02:55 -08:00
|
|
|
\\source.zig:12:5: [address] in make_error (test)
|
2020-01-21 13:58:51 -08:00
|
|
|
\\ return error.TheSkyIsFalling;
|
|
|
|
\\ ^
|
2020-02-22 09:02:55 -08:00
|
|
|
\\source.zig:8:5: [address] in bar (test)
|
2020-01-21 13:58:51 -08:00
|
|
|
\\ return make_error();
|
|
|
|
\\ ^
|
2020-02-22 09:02:55 -08:00
|
|
|
\\source.zig:4:5: [address] in foo (test)
|
2020-01-21 13:58:51 -08:00
|
|
|
\\ try bar();
|
|
|
|
\\ ^
|
2020-02-22 09:02:55 -08:00
|
|
|
\\source.zig:16:5: [address] in main (test)
|
2020-01-21 13:58:51 -08:00
|
|
|
\\ try foo();
|
|
|
|
\\ ^
|
2019-05-27 17:07:05 -07:00
|
|
|
\\
|
|
|
|
,
|
2019-09-03 07:05:19 -07:00
|
|
|
// release-safe
|
2019-09-07 20:04:01 -07:00
|
|
|
\\error: TheSkyIsFalling
|
2020-02-22 09:02:55 -08:00
|
|
|
\\source.zig:12:5: [address] in std.start.main (test)
|
2020-01-21 13:58:51 -08:00
|
|
|
\\ return error.TheSkyIsFalling;
|
|
|
|
\\ ^
|
2020-02-22 09:02:55 -08:00
|
|
|
\\source.zig:8:5: [address] in std.start.main (test)
|
2020-01-21 13:58:51 -08:00
|
|
|
\\ return make_error();
|
|
|
|
\\ ^
|
2020-02-22 09:02:55 -08:00
|
|
|
\\source.zig:4:5: [address] in std.start.main (test)
|
2020-01-21 13:58:51 -08:00
|
|
|
\\ try bar();
|
|
|
|
\\ ^
|
2020-02-22 09:02:55 -08:00
|
|
|
\\source.zig:16:5: [address] in std.start.main (test)
|
2020-01-21 13:58:51 -08:00
|
|
|
\\ try foo();
|
|
|
|
\\ ^
|
2019-05-27 17:07:05 -07:00
|
|
|
\\
|
|
|
|
,
|
2019-09-03 07:05:19 -07:00
|
|
|
// release-fast
|
2020-02-07 08:08:21 -08:00
|
|
|
\\error: TheSkyIsFalling
|
2019-05-27 17:07:05 -07:00
|
|
|
\\
|
|
|
|
,
|
2019-09-03 07:05:19 -07:00
|
|
|
// release-small
|
2020-02-07 08:08:21 -08:00
|
|
|
\\error: TheSkyIsFalling
|
2019-05-27 17:07:05 -07:00
|
|
|
\\
|
|
|
|
},
|
|
|
|
);
|
|
|
|
},
|
|
|
|
.windows => {
|
|
|
|
cases.addCase(
|
|
|
|
"return",
|
|
|
|
source_return,
|
2019-09-03 07:05:19 -07:00
|
|
|
[_][]const u8{
|
|
|
|
// debug
|
2020-02-07 08:08:21 -08:00
|
|
|
\\error: TheSkyIsFalling
|
2019-05-27 17:07:05 -07:00
|
|
|
\\source.zig:4:5: [address] in main (test.obj)
|
2020-01-21 13:58:51 -08:00
|
|
|
\\ return error.TheSkyIsFalling;
|
|
|
|
\\ ^
|
2019-05-27 17:07:05 -07:00
|
|
|
\\
|
|
|
|
,
|
2019-09-03 07:05:19 -07:00
|
|
|
// release-safe
|
|
|
|
// --disabled-- results in segmenetation fault
|
|
|
|
"",
|
|
|
|
// release-fast
|
2020-02-07 08:08:21 -08:00
|
|
|
\\error: TheSkyIsFalling
|
2019-05-27 17:07:05 -07:00
|
|
|
\\
|
|
|
|
,
|
2019-09-03 07:05:19 -07:00
|
|
|
// release-small
|
2020-02-07 08:08:21 -08:00
|
|
|
\\error: TheSkyIsFalling
|
2019-05-27 17:07:05 -07:00
|
|
|
\\
|
|
|
|
},
|
|
|
|
);
|
|
|
|
cases.addCase(
|
|
|
|
"try return",
|
|
|
|
source_try_return,
|
2019-09-03 07:05:19 -07:00
|
|
|
[_][]const u8{
|
|
|
|
// debug
|
2020-02-22 09:02:55 -08:00
|
|
|
\\error: TheSkyIsFalling
|
2019-05-27 17:07:05 -07:00
|
|
|
\\source.zig:4:5: [address] in foo (test.obj)
|
2020-01-21 13:58:51 -08:00
|
|
|
\\ return error.TheSkyIsFalling;
|
|
|
|
\\ ^
|
2019-05-27 17:07:05 -07:00
|
|
|
\\source.zig:8:5: [address] in main (test.obj)
|
2020-01-21 13:58:51 -08:00
|
|
|
\\ try foo();
|
|
|
|
\\ ^
|
2019-05-27 17:07:05 -07:00
|
|
|
\\
|
|
|
|
,
|
2019-09-03 07:05:19 -07:00
|
|
|
// release-safe
|
|
|
|
// --disabled-- results in segmenetation fault
|
|
|
|
"",
|
|
|
|
// release-fast
|
2020-02-07 08:08:21 -08:00
|
|
|
\\error: TheSkyIsFalling
|
2019-05-27 17:07:05 -07:00
|
|
|
\\
|
|
|
|
,
|
2019-09-03 07:05:19 -07:00
|
|
|
// release-small
|
2020-02-07 08:08:21 -08:00
|
|
|
\\error: TheSkyIsFalling
|
2019-05-27 17:07:05 -07:00
|
|
|
\\
|
|
|
|
},
|
|
|
|
);
|
|
|
|
cases.addCase(
|
|
|
|
"try try return return",
|
|
|
|
source_try_try_return_return,
|
2019-09-03 07:05:19 -07:00
|
|
|
[_][]const u8{
|
|
|
|
// debug
|
2020-02-22 09:02:55 -08:00
|
|
|
\\error: TheSkyIsFalling
|
2019-05-27 17:07:05 -07:00
|
|
|
\\source.zig:12:5: [address] in make_error (test.obj)
|
2020-01-21 13:58:51 -08:00
|
|
|
\\ return error.TheSkyIsFalling;
|
|
|
|
\\ ^
|
2019-05-27 17:07:05 -07:00
|
|
|
\\source.zig:8:5: [address] in bar (test.obj)
|
2020-01-21 13:58:51 -08:00
|
|
|
\\ return make_error();
|
|
|
|
\\ ^
|
2019-05-27 17:07:05 -07:00
|
|
|
\\source.zig:4:5: [address] in foo (test.obj)
|
2020-01-21 13:58:51 -08:00
|
|
|
\\ try bar();
|
|
|
|
\\ ^
|
2019-05-27 17:07:05 -07:00
|
|
|
\\source.zig:16:5: [address] in main (test.obj)
|
2020-01-21 13:58:51 -08:00
|
|
|
\\ try foo();
|
|
|
|
\\ ^
|
2019-05-27 17:07:05 -07:00
|
|
|
\\
|
|
|
|
,
|
2019-09-03 07:05:19 -07:00
|
|
|
// release-safe
|
|
|
|
// --disabled-- results in segmenetation fault
|
|
|
|
"",
|
|
|
|
// release-fast
|
2020-02-07 08:08:21 -08:00
|
|
|
\\error: TheSkyIsFalling
|
2019-05-27 17:07:05 -07:00
|
|
|
\\
|
|
|
|
,
|
2019-09-03 07:05:19 -07:00
|
|
|
// release-small
|
2020-02-07 08:08:21 -08:00
|
|
|
\\error: TheSkyIsFalling
|
2019-05-27 17:07:05 -07:00
|
|
|
\\
|
|
|
|
},
|
|
|
|
);
|
|
|
|
},
|
|
|
|
else => {},
|
|
|
|
}
|
|
|
|
}
|
2020-02-22 09:02:55 -08:00
|
|
|
// zig fmt: off
|