| ... | ... | @@ -3,8 +3,7 @@ const tests = @import("tests.zig"); |
| 3 | 3 | pub fn addCases(cases: &tests.CompareOutputContext) { |
| 4 | 4 | cases.addDebugSafety("calling panic", |
| 5 | 5 | \\pub fn panic(message: []const u8) -> noreturn { |
| 6 | | \\ @breakpoint(); |
| 7 | | \\ while (true) {} |
| 6 | \\ @import("std").os.exit(126); |
| 8 | 7 | \\} |
| 9 | 8 | \\pub fn main() -> %void { |
| 10 | 9 | \\ @panic("oh no"); |
| ... | ... | @@ -13,8 +12,7 @@ pub fn addCases(cases: &tests.CompareOutputContext) { |
| 13 | 12 | |
| 14 | 13 | cases.addDebugSafety("out of bounds slice access", |
| 15 | 14 | \\pub fn panic(message: []const u8) -> noreturn { |
| 16 | | \\ @breakpoint(); |
| 17 | | \\ while (true) {} |
| 15 | \\ @import("std").os.exit(126); |
| 18 | 16 | \\} |
| 19 | 17 | \\pub fn main() -> %void { |
| 20 | 18 | \\ const a = []i32{1, 2, 3, 4}; |
| ... | ... | @@ -28,8 +26,7 @@ pub fn addCases(cases: &tests.CompareOutputContext) { |
| 28 | 26 | |
| 29 | 27 | cases.addDebugSafety("integer addition overflow", |
| 30 | 28 | \\pub fn panic(message: []const u8) -> noreturn { |
| 31 | | \\ @breakpoint(); |
| 32 | | \\ while (true) {} |
| 29 | \\ @import("std").os.exit(126); |
| 33 | 30 | \\} |
| 34 | 31 | \\error Whatever; |
| 35 | 32 | \\pub fn main() -> %void { |
| ... | ... | @@ -43,8 +40,7 @@ pub fn addCases(cases: &tests.CompareOutputContext) { |
| 43 | 40 | |
| 44 | 41 | cases.addDebugSafety("integer subtraction overflow", |
| 45 | 42 | \\pub fn panic(message: []const u8) -> noreturn { |
| 46 | | \\ @breakpoint(); |
| 47 | | \\ while (true) {} |
| 43 | \\ @import("std").os.exit(126); |
| 48 | 44 | \\} |
| 49 | 45 | \\error Whatever; |
| 50 | 46 | \\pub fn main() -> %void { |
| ... | ... | @@ -58,8 +54,7 @@ pub fn addCases(cases: &tests.CompareOutputContext) { |
| 58 | 54 | |
| 59 | 55 | cases.addDebugSafety("integer multiplication overflow", |
| 60 | 56 | \\pub fn panic(message: []const u8) -> noreturn { |
| 61 | | \\ @breakpoint(); |
| 62 | | \\ while (true) {} |
| 57 | \\ @import("std").os.exit(126); |
| 63 | 58 | \\} |
| 64 | 59 | \\error Whatever; |
| 65 | 60 | \\pub fn main() -> %void { |
| ... | ... | @@ -73,8 +68,7 @@ pub fn addCases(cases: &tests.CompareOutputContext) { |
| 73 | 68 | |
| 74 | 69 | cases.addDebugSafety("integer negation overflow", |
| 75 | 70 | \\pub fn panic(message: []const u8) -> noreturn { |
| 76 | | \\ @breakpoint(); |
| 77 | | \\ while (true) {} |
| 71 | \\ @import("std").os.exit(126); |
| 78 | 72 | \\} |
| 79 | 73 | \\error Whatever; |
| 80 | 74 | \\pub fn main() -> %void { |
| ... | ... | @@ -88,8 +82,7 @@ pub fn addCases(cases: &tests.CompareOutputContext) { |
| 88 | 82 | |
| 89 | 83 | cases.addDebugSafety("signed integer division overflow", |
| 90 | 84 | \\pub fn panic(message: []const u8) -> noreturn { |
| 91 | | \\ @breakpoint(); |
| 92 | | \\ while (true) {} |
| 85 | \\ @import("std").os.exit(126); |
| 93 | 86 | \\} |
| 94 | 87 | \\error Whatever; |
| 95 | 88 | \\pub fn main() -> %void { |
| ... | ... | @@ -103,8 +96,7 @@ pub fn addCases(cases: &tests.CompareOutputContext) { |
| 103 | 96 | |
| 104 | 97 | cases.addDebugSafety("signed shift left overflow", |
| 105 | 98 | \\pub fn panic(message: []const u8) -> noreturn { |
| 106 | | \\ @breakpoint(); |
| 107 | | \\ while (true) {} |
| 99 | \\ @import("std").os.exit(126); |
| 108 | 100 | \\} |
| 109 | 101 | \\error Whatever; |
| 110 | 102 | \\pub fn main() -> %void { |
| ... | ... | @@ -118,8 +110,7 @@ pub fn addCases(cases: &tests.CompareOutputContext) { |
| 118 | 110 | |
| 119 | 111 | cases.addDebugSafety("unsigned shift left overflow", |
| 120 | 112 | \\pub fn panic(message: []const u8) -> noreturn { |
| 121 | | \\ @breakpoint(); |
| 122 | | \\ while (true) {} |
| 113 | \\ @import("std").os.exit(126); |
| 123 | 114 | \\} |
| 124 | 115 | \\error Whatever; |
| 125 | 116 | \\pub fn main() -> %void { |
| ... | ... | @@ -133,8 +124,7 @@ pub fn addCases(cases: &tests.CompareOutputContext) { |
| 133 | 124 | |
| 134 | 125 | cases.addDebugSafety("signed shift right overflow", |
| 135 | 126 | \\pub fn panic(message: []const u8) -> noreturn { |
| 136 | | \\ @breakpoint(); |
| 137 | | \\ while (true) {} |
| 127 | \\ @import("std").os.exit(126); |
| 138 | 128 | \\} |
| 139 | 129 | \\error Whatever; |
| 140 | 130 | \\pub fn main() -> %void { |
| ... | ... | @@ -148,8 +138,7 @@ pub fn addCases(cases: &tests.CompareOutputContext) { |
| 148 | 138 | |
| 149 | 139 | cases.addDebugSafety("unsigned shift right overflow", |
| 150 | 140 | \\pub fn panic(message: []const u8) -> noreturn { |
| 151 | | \\ @breakpoint(); |
| 152 | | \\ while (true) {} |
| 141 | \\ @import("std").os.exit(126); |
| 153 | 142 | \\} |
| 154 | 143 | \\error Whatever; |
| 155 | 144 | \\pub fn main() -> %void { |
| ... | ... | @@ -163,8 +152,7 @@ pub fn addCases(cases: &tests.CompareOutputContext) { |
| 163 | 152 | |
| 164 | 153 | cases.addDebugSafety("integer division by zero", |
| 165 | 154 | \\pub fn panic(message: []const u8) -> noreturn { |
| 166 | | \\ @breakpoint(); |
| 167 | | \\ while (true) {} |
| 155 | \\ @import("std").os.exit(126); |
| 168 | 156 | \\} |
| 169 | 157 | \\error Whatever; |
| 170 | 158 | \\pub fn main() -> %void { |
| ... | ... | @@ -177,8 +165,7 @@ pub fn addCases(cases: &tests.CompareOutputContext) { |
| 177 | 165 | |
| 178 | 166 | cases.addDebugSafety("exact division failure", |
| 179 | 167 | \\pub fn panic(message: []const u8) -> noreturn { |
| 180 | | \\ @breakpoint(); |
| 181 | | \\ while (true) {} |
| 168 | \\ @import("std").os.exit(126); |
| 182 | 169 | \\} |
| 183 | 170 | \\error Whatever; |
| 184 | 171 | \\pub fn main() -> %void { |
| ... | ... | @@ -192,8 +179,7 @@ pub fn addCases(cases: &tests.CompareOutputContext) { |
| 192 | 179 | |
| 193 | 180 | cases.addDebugSafety("cast []u8 to bigger slice of wrong size", |
| 194 | 181 | \\pub fn panic(message: []const u8) -> noreturn { |
| 195 | | \\ @breakpoint(); |
| 196 | | \\ while (true) {} |
| 182 | \\ @import("std").os.exit(126); |
| 197 | 183 | \\} |
| 198 | 184 | \\error Whatever; |
| 199 | 185 | \\pub fn main() -> %void { |
| ... | ... | @@ -207,8 +193,7 @@ pub fn addCases(cases: &tests.CompareOutputContext) { |
| 207 | 193 | |
| 208 | 194 | cases.addDebugSafety("value does not fit in shortening cast", |
| 209 | 195 | \\pub fn panic(message: []const u8) -> noreturn { |
| 210 | | \\ @breakpoint(); |
| 211 | | \\ while (true) {} |
| 196 | \\ @import("std").os.exit(126); |
| 212 | 197 | \\} |
| 213 | 198 | \\error Whatever; |
| 214 | 199 | \\pub fn main() -> %void { |
| ... | ... | @@ -222,8 +207,7 @@ pub fn addCases(cases: &tests.CompareOutputContext) { |
| 222 | 207 | |
| 223 | 208 | cases.addDebugSafety("signed integer not fitting in cast to unsigned integer", |
| 224 | 209 | \\pub fn panic(message: []const u8) -> noreturn { |
| 225 | | \\ @breakpoint(); |
| 226 | | \\ while (true) {} |
| 210 | \\ @import("std").os.exit(126); |
| 227 | 211 | \\} |
| 228 | 212 | \\error Whatever; |
| 229 | 213 | \\pub fn main() -> %void { |
| ... | ... | @@ -237,8 +221,7 @@ pub fn addCases(cases: &tests.CompareOutputContext) { |
| 237 | 221 | |
| 238 | 222 | cases.addDebugSafety("unwrap error", |
| 239 | 223 | \\pub fn panic(message: []const u8) -> noreturn { |
| 240 | | \\ @breakpoint(); |
| 241 | | \\ while (true) {} |
| 224 | \\ @import("std").os.exit(126); |
| 242 | 225 | \\} |
| 243 | 226 | \\error Whatever; |
| 244 | 227 | \\pub fn main() -> %void { |
| ... | ... | @@ -251,8 +234,7 @@ pub fn addCases(cases: &tests.CompareOutputContext) { |
| 251 | 234 | |
| 252 | 235 | cases.addDebugSafety("cast integer to error and no code matches", |
| 253 | 236 | \\pub fn panic(message: []const u8) -> noreturn { |
| 254 | | \\ @breakpoint(); |
| 255 | | \\ while (true) {} |
| 237 | \\ @import("std").os.exit(126); |
| 256 | 238 | \\} |
| 257 | 239 | \\pub fn main() -> %void { |
| 258 | 240 | \\ _ = bar(9999); |
| ... | ... | @@ -264,8 +246,7 @@ pub fn addCases(cases: &tests.CompareOutputContext) { |
| 264 | 246 | |
| 265 | 247 | cases.addDebugSafety("@alignCast misaligned", |
| 266 | 248 | \\pub fn panic(message: []const u8) -> noreturn { |
| 267 | | \\ @breakpoint(); |
| 268 | | \\ while (true) {} |
| 249 | \\ @import("std").os.exit(126); |
| 269 | 250 | \\} |
| 270 | 251 | \\error Wrong; |
| 271 | 252 | \\pub fn main() -> %void { |