| ... | ... | @@ -6151,32 +6151,33 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 6151 | 6151 | "tmp.zig:2:15: error: expected error union type, found '?i32'", |
| 6152 | 6152 | }); |
| 6153 | 6153 | |
| 6154 | | cases.add("inline fn calls itself indirectly", |
| 6155 | | \\export fn foo() void { |
| 6156 | | \\ bar(); |
| 6157 | | \\} |
| 6158 | | \\inline fn bar() void { |
| 6159 | | \\ baz(); |
| 6160 | | \\ quux(); |
| 6161 | | \\} |
| 6162 | | \\inline fn baz() void { |
| 6163 | | \\ bar(); |
| 6164 | | \\ quux(); |
| 6165 | | \\} |
| 6166 | | \\extern fn quux() void; |
| 6167 | | , &[_][]const u8{ |
| 6168 | | "tmp.zig:4:1: error: unable to inline function", |
| 6169 | | }); |
| 6170 | | |
| 6171 | | cases.add("save reference to inline function", |
| 6172 | | \\export fn foo() void { |
| 6173 | | \\ quux(@ptrToInt(bar)); |
| 6174 | | \\} |
| 6175 | | \\inline fn bar() void { } |
| 6176 | | \\extern fn quux(usize) void; |
| 6177 | | , &[_][]const u8{ |
| 6178 | | "tmp.zig:4:1: error: unable to inline function", |
| 6179 | | }); |
| 6154 | // TODO test this in stage2, but we won't even try in stage1 |
| 6155 | //cases.add("inline fn calls itself indirectly", |
| 6156 | // \\export fn foo() void { |
| 6157 | // \\ bar(); |
| 6158 | // \\} |
| 6159 | // \\inline fn bar() void { |
| 6160 | // \\ baz(); |
| 6161 | // \\ quux(); |
| 6162 | // \\} |
| 6163 | // \\inline fn baz() void { |
| 6164 | // \\ bar(); |
| 6165 | // \\ quux(); |
| 6166 | // \\} |
| 6167 | // \\extern fn quux() void; |
| 6168 | //, &[_][]const u8{ |
| 6169 | // "tmp.zig:4:1: error: unable to inline function", |
| 6170 | //}); |
| 6171 | |
| 6172 | //cases.add("save reference to inline function", |
| 6173 | // \\export fn foo() void { |
| 6174 | // \\ quux(@ptrToInt(bar)); |
| 6175 | // \\} |
| 6176 | // \\inline fn bar() void { } |
| 6177 | // \\extern fn quux(usize) void; |
| 6178 | //, &[_][]const u8{ |
| 6179 | // "tmp.zig:4:1: error: unable to inline function", |
| 6180 | //}); |
| 6180 | 6181 | |
| 6181 | 6182 | cases.add("signed integer division", |
| 6182 | 6183 | \\export fn foo(a: i32, b: i32) i32 { |