| ... | @@ -61,63 +61,4 @@ pub fn addCases(ctx: *TestContext) !void { | ... | @@ -61,63 +61,4 @@ pub fn addCases(ctx: *TestContext) !void { |
| 61 | \\@0 = str("_start") | 61 | \\@0 = str("_start") |
| 62 | \\@1 = export(@0, "start") | 62 | \\@1 = export(@0, "start") |
| 63 | ); | 63 | ); |
| 64 | | | |
| 65 | ctx.compileError("function redefinition", linux_x64, | | |
| 66 | \\fn entry() void {} | | |
| 67 | \\fn entry() void {} | | |
| 68 | , &[_][]const u8{":2:4: error: redefinition of 'entry'"}); | | |
| 69 | | | |
| 70 | ctx.compileError("incorrect return type", linux_x64, | | |
| 71 | \\export fn _start() noreturn { | | |
| 72 | \\} | | |
| 73 | , &[_][]const u8{":2:1: error: expected noreturn, found void"}); | | |
| 74 | | | |
| 75 | ctx.compileError("extern variable has no type", linux_x64, | | |
| 76 | \\comptime { | | |
| 77 | \\ _ = foo; | | |
| 78 | \\} | | |
| 79 | \\extern var foo; | | |
| 80 | , &[_][]const u8{":4:1: error: unable to infer variable type"}); | | |
| 81 | | | |
| 82 | //ctx.incrementalFailure("function redefinition", linux_x64, | | |
| 83 | // \\fn entry() void {} | | |
| 84 | // \\fn entry() void {} | | |
| 85 | //, &[_][]const u8{":2:4: error: redefinition of 'entry'"}, | | |
| 86 | // \\fn entry() void {} | | |
| 87 | //); | | |
| 88 | | | |
| 89 | //// TODO: need to make sure this works with other variants of export. | | |
| 90 | //ctx.incrementalFailure("exported symbol collision", linux_x64, | | |
| 91 | // \\export fn entry() void {} | | |
| 92 | // \\export fn entry() void {} | | |
| 93 | //, &[_][]const u8{":2:11: error: redefinition of 'entry'"}, | | |
| 94 | // \\export fn entry() void {} | | |
| 95 | //); | | |
| 96 | | | |
| 97 | // ctx.incrementalFailure("missing function name", linux_x64, | | |
| 98 | // \\fn() void {} | | |
| 99 | // , &[_][]const u8{":1:3: error: missing function name"}, | | |
| 100 | // \\fn a() void {} | | |
| 101 | // ); | | |
| 102 | | | |
| 103 | // TODO: re-enable these tests. | | |
| 104 | // https://github.com/ziglang/zig/issues/1364 | | |
| 105 | | | |
| 106 | //ctx.testCompileError( | | |
| 107 | // \\comptime { | | |
| 108 | // \\ return; | | |
| 109 | // \\} | | |
| 110 | //, "1.zig", 2, 5, "return expression outside function definition"); | | |
| 111 | | | |
| 112 | //ctx.testCompileError( | | |
| 113 | // \\export fn entry() void { | | |
| 114 | // \\ defer return; | | |
| 115 | // \\} | | |
| 116 | //, "1.zig", 2, 11, "cannot return from defer expression"); | | |
| 117 | | | |
| 118 | //ctx.testCompileError( | | |
| 119 | // \\export fn entry() c_int { | | |
| 120 | // \\ return 36893488147419103232; | | |
| 121 | // \\} | | |
| 122 | //, "1.zig", 2, 12, "integer value '36893488147419103232' cannot be stored in type 'c_int'"); | | |
| 123 | } | 64 | } |