Commit 62625d9d95

Jakub Konka <kubkon@jakubkonka.com>
2022-04-28 14:44:34
test: migrate stage1 compile error tests to updated test manifest
1 parent c8d0fb0
Changed files (678)
src
test
compile_errors
stage1
exe
obj
test
stage2
src/test.zig
@@ -34,15 +34,12 @@ test {
     var ctx = TestContext.init(std.testing.allocator, arena);
     defer ctx.deinit();
 
-    const compile_errors_dir_path = try std.fs.path.join(arena, &.{
-        std.fs.path.dirname(@src().file).?, "..", "test", "compile_errors",
-    });
-
-    var compile_errors_dir = try std.fs.cwd().openDir(compile_errors_dir_path, .{});
-    defer compile_errors_dir.close();
-
     {
-        var dir = try compile_errors_dir.openDir("stage2", .{ .iterate = true });
+        const dir_path = try std.fs.path.join(arena, &.{
+            std.fs.path.dirname(@src().file).?, "..", "test", "compile_errors",
+        });
+
+        var dir = try std.fs.cwd().openDir(dir_path, .{ .iterate = true });
         defer dir.close();
 
         // TODO make this incremental once the bug is solved that it triggers
@@ -50,28 +47,6 @@ test {
         ctx.addTestCasesFromDir(dir, .independent);
     }
 
-    if (!skip_stage1) {
-        var stage1_dir = try compile_errors_dir.openDir("stage1", .{});
-        defer stage1_dir.close();
-
-        const Config = struct {
-            name: []const u8,
-            is_test: bool,
-            output_mode: std.builtin.OutputMode,
-        };
-
-        for ([_]Config{
-            .{ .name = "obj", .is_test = false, .output_mode = .Obj },
-            .{ .name = "exe", .is_test = false, .output_mode = .Exe },
-            .{ .name = "test", .is_test = true, .output_mode = .Exe },
-        }) |config| {
-            var dir = try stage1_dir.openDir(config.name, .{ .iterate = true });
-            defer dir.close();
-
-            ctx.addErrorCasesFromDir("stage1", dir, .stage1, config.output_mode, config.is_test, .independent);
-        }
-    }
-
     {
         const dir_path = try std.fs.path.join(arena, &.{
             std.fs.path.dirname(@src().file).?, "..", "test", "incremental",
test/compile_errors/stage1/exe/main_missing_name.zig
@@ -1,5 +1,8 @@
 pub fn (main) void {}
 
-// main missing name
+// error
+// backend=stage1
+// target=native
+// output_mode=Exe
 //
 // tmp.zig:1:5: error: missing function name
test/compile_errors/stage1/exe/missing_main_fn_in_executable.zig
@@ -1,5 +1,8 @@
 
 
-// missing main fn in executable
+// error
+// backend=stage1
+// target=native
+// output_mode=Exe
 //
 // error: root source file has no member called 'main'
test/compile_errors/stage1/exe/private_main_fn.zig
@@ -1,6 +1,9 @@
 fn main() void {}
 
-// private main fn
+// error
+// backend=stage1
+// target=native
+// output_mode=Exe
 //
 // error: 'main' is private
 // tmp.zig:1:1: note: declared here
test/compile_errors/stage1/obj/access_non-existent_member_of_error_set.zig
@@ -4,6 +4,8 @@ comptime {
     _ = z;
 }
 
-// access non-existent member of error set
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:3:18: error: no error named 'Bar' in 'Foo'
test/compile_errors/stage1/obj/accessing_runtime_parameter_from_outer_function.zig
@@ -12,7 +12,9 @@ export fn entry() void {
     _ = x;
 }
 
-// accessing runtime parameter from outer function
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:4:24: error: 'y' not accessible from inner function
 // tmp.zig:3:28: note: crossed function definition here
test/compile_errors/stage1/obj/add_assign_on_undefined_value.zig
@@ -3,6 +3,8 @@ comptime {
     a += a;
 }
 
-// add assign on undefined value
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:3:5: error: use of undefined value here causes undefined behavior
test/compile_errors/stage1/obj/add_on_undefined_value.zig
@@ -3,6 +3,8 @@ comptime {
     _ = a + a;
 }
 
-// add on undefined value
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:3:9: error: use of undefined value here causes undefined behavior
test/compile_errors/stage1/obj/add_overflow_in_function_evaluation.zig
@@ -5,6 +5,8 @@ fn add(a: u16, b: u16) u16 {
 
 export fn entry() usize { return @sizeOf(@TypeOf(y)); }
 
-// add overflow in function evaluation
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:3:14: error: operation caused overflow
test/compile_errors/stage1/obj/add_wrap_assign_on_undefined_value.zig
@@ -3,6 +3,8 @@ comptime {
     a +%= a;
 }
 
-// add wrap assign on undefined value
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:3:5: error: use of undefined value here causes undefined behavior
test/compile_errors/stage1/obj/add_wrap_on_undefined_value.zig
@@ -3,6 +3,8 @@ comptime {
     _ = a +% a;
 }
 
-// add wrap on undefined value
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:3:9: error: use of undefined value here causes undefined behavior
test/compile_errors/stage1/obj/addition_with_non_numbers.zig
@@ -5,6 +5,8 @@ const x = Foo {.field = 1} + Foo {.field = 2};
 
 export fn entry() usize { return @sizeOf(@TypeOf(x)); }
 
-// addition with non numbers
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:4:28: error: invalid operands to binary expression: 'Foo' and 'Foo'
test/compile_errors/stage1/obj/address_of_number_literal.zig
@@ -3,6 +3,8 @@ const y = &x;
 fn foo() *const i32 { return y; }
 export fn entry() usize { return @sizeOf(@TypeOf(foo)); }
 
-// address of number literal
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:3:30: error: expected type '*const i32', found '*const comptime_int'
test/compile_errors/stage1/obj/align_n_expr_function_pointers_is_a_compile_error.zig
@@ -0,0 +1,9 @@
+export fn foo() align(1) void {
+    return;
+}
+
+// error
+// backend=stage1
+// target=wasm32-freestanding-none
+//
+// tmp.zig:1:23: error: align(N) expr is not allowed on function prototypes in wasm32/wasm64
test/compile_errors/stage1/obj/alignCast_expects_pointer_or_slice.zig
@@ -2,6 +2,8 @@ export fn entry() void {
     @alignCast(4, @as(u32, 3));
 }
 
-// @alignCast expects pointer or slice
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:2:19: error: expected pointer or slice, found 'u32'
test/compile_errors/stage1/obj/aligned_variable_of_zero-bit_type.zig
@@ -3,6 +3,8 @@ export fn f() void {
     _ = s;
 }
 
-// aligned variable of zero-bit type
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:2:5: error: variable 's' of zero-bit type 'struct:2:12' has no in-memory representation, it cannot be aligned
test/compile_errors/stage1/obj/alignment_of_enum_field_specified.zig
@@ -7,6 +7,8 @@ export fn entry1() void {
     _ = x;
 }
 
-// alignment of enum field specified
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:3:7: error: expected ',' after field
test/compile_errors/stage1/obj/ambiguous_decl_reference.zig
@@ -12,7 +12,9 @@ export fn entry() void {
     bar();
 }
 
-// ambiguous decl reference
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:5:13: error: ambiguous reference
 // tmp.zig:7:9: note: declared here
test/compile_errors/stage1/obj/and_on_undefined_value.zig
@@ -3,6 +3,8 @@ comptime {
     _ = a and a;
 }
 
-// and on undefined value
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:3:9: error: use of undefined value here causes undefined behavior
test/compile_errors/stage1/obj/array_access_of_non_array.zig
@@ -7,7 +7,9 @@ export fn g() void {
     _ = bad[0];
 }
 
-// array access of non array
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:3:8: error: array access of non-array type 'bool'
 // tmp.zig:7:12: error: array access of non-array type 'bool'
test/compile_errors/stage1/obj/array_access_of_type.zig
@@ -3,6 +3,8 @@ export fn foo() void {
     _ = b;
 }
 
-// array access of type
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:2:14: error: array access of non-array type 'type'
test/compile_errors/stage1/obj/array_access_of_undeclared_identifier.zig
@@ -2,6 +2,8 @@ export fn f() void {
     i[i] = i[i];
 }
 
-// array access of undeclared identifier
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:2:5: error: use of undeclared identifier 'i'
test/compile_errors/stage1/obj/array_access_with_non_integer_index.zig
@@ -9,7 +9,9 @@ export fn g() void {
     _ = array[bad];
 }
 
-// array access with non integer index
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:4:11: error: expected type 'usize', found 'bool'
 // tmp.zig:9:15: error: expected type 'usize', found 'bool'
test/compile_errors/stage1/obj/array_concatenation_with_wrong_type.zig
@@ -4,6 +4,8 @@ const a = derp ++ "foo";
 
 export fn entry() usize { return @sizeOf(@TypeOf(a)); }
 
-// array concatenation with wrong type
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:3:11: error: expected array, found 'usize'
test/compile_errors/stage1/obj/array_in_c_exported_function.zig
@@ -6,7 +6,9 @@ export fn zig_return_array() [10]u8 {
     return "1234567890".*;
 }
 
-// array in c exported function
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:1:24: error: parameter of type '[10]u8' not allowed in function with calling convention 'C'
 // tmp.zig:5:30: error: return type '[10]u8' not allowed in function with calling convention 'C'
test/compile_errors/stage1/obj/asm_at_compile_time.zig
@@ -10,6 +10,8 @@ fn doSomeAsm() void {
     );
 }
 
-// asm at compile time
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:6:5: error: unable to evaluate constant expression
test/compile_errors/stage1/obj/assign_inline_fn_to_non-comptime_var.zig
@@ -4,7 +4,9 @@ export fn entry() void {
 }
 fn b() callconv(.Inline) void { }
 
-// assign inline fn to non-comptime var
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:2:5: error: functions marked inline must be stored in const or comptime var
 // tmp.zig:5:1: note: declared here
test/compile_errors/stage1/obj/assign_null_to_non-optional_pointer.zig
@@ -2,6 +2,8 @@ const a: *u8 = null;
 
 export fn entry() usize { return @sizeOf(@TypeOf(a)); }
 
-// assign null to non-optional pointer
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:1:16: error: expected type '*u8', found '@Type(.Null)'
test/compile_errors/stage1/obj/assign_through_constant_pointer.zig
@@ -3,6 +3,8 @@ export fn f() void {
   cstr[0] = 'W';
 }
 
-// assign through constant pointer
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:3:13: error: cannot assign to constant
test/compile_errors/stage1/obj/assign_through_constant_slice.zig
@@ -3,6 +3,8 @@ export fn f() void {
   cstr[0] = 'W';
 }
 
-// assign through constant slice
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:3:13: error: cannot assign to constant
test/compile_errors/stage1/obj/assign_to_constant_field.zig
@@ -6,6 +6,8 @@ export fn derp() void {
     f.field = 0;
 }
 
-// assign to constant field
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:6:15: error: cannot assign to constant
test/compile_errors/stage1/obj/assign_to_constant_variable.zig
@@ -3,6 +3,8 @@ export fn f() void {
     a = 4;
 }
 
-// assign to constant variable
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:3:9: error: cannot assign to constant
test/compile_errors/stage1/obj/assign_to_invalid_dereference.zig
@@ -2,6 +2,8 @@ export fn entry() void {
     'a'.* = 1;
 }
 
-// assign to invalid dereference
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:2:8: error: attempt to dereference non-pointer type 'comptime_int'
test/compile_errors/stage1/obj/assign_too_big_number_to_u16.zig
@@ -3,6 +3,8 @@ export fn foo() void {
     _ = vga_mem;
 }
 
-// assign too big number to u16
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:2:24: error: integer value 753664 cannot be coerced to type 'u16'
test/compile_errors/stage1/obj/assign_unreachable.zig
@@ -2,7 +2,9 @@ export fn f() void {
     const a = return;
 }
 
-// assign unreachable
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:2:5: error: unreachable code
 // tmp.zig:2:15: note: control flow is diverted here
test/compile_errors/stage1/obj/assigning_to_struct_or_union_fields_that_are_not_optionals_with_a_function_that_returns_an_optional.zig
@@ -14,6 +14,8 @@ export fn entry() void {
     _ = s;
 }
 
-// assigning to struct or union fields that are not optionals with a function that returns an optional
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:11:27: error: cannot convert optional to payload type. consider using `.?`, `orelse`, or `if`. expected type 'u8', found '?u8'
test/compile_errors/stage1/obj/async_function_depends_on_its_own_frame.zig
@@ -6,6 +6,8 @@ fn amain() callconv(.Async) void {
     _ = x;
 }
 
-// async function depends on its own frame
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:4:1: error: cannot resolve '@Frame(amain)': function not fully analyzed yet
test/compile_errors/stage1/obj/async_function_indirectly_depends_on_its_own_frame.zig
@@ -9,7 +9,9 @@ fn other() void {
     _ = x;
 }
 
-// async function indirectly depends on its own frame
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:4:1: error: unable to determine async function frame of 'amain'
 // tmp.zig:5:10: note: analysis of function 'other' depends on the frame
test/compile_errors/stage1/obj/atomic_orderings_of_atomicStore_Acquire_or_AcqRel.zig
@@ -3,6 +3,8 @@ export fn entry() void {
     @atomicStore(u32, &x, 1, .Acquire);
 }
 
-// atomic orderings of atomicStore Acquire or AcqRel
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:3:30: error: @atomicStore atomic ordering must not be Acquire or AcqRel
test/compile_errors/stage1/obj/atomic_orderings_of_cmpxchg-failure_stricter_than_success.zig
@@ -4,6 +4,8 @@ export fn f() void {
     while (!@cmpxchgWeak(i32, &x, 1234, 5678, AtomicOrder.Monotonic, AtomicOrder.SeqCst)) {}
 }
 
-// atomic orderings of cmpxchg - failure stricter than success
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:4:81: error: failure atomic ordering must be no stricter than success
test/compile_errors/stage1/obj/atomic_orderings_of_cmpxchg-success_Monotonic_or_stricter.zig
@@ -4,6 +4,8 @@ export fn f() void {
     while (!@cmpxchgWeak(i32, &x, 1234, 5678, AtomicOrder.Unordered, AtomicOrder.Unordered)) {}
 }
 
-// atomic orderings of cmpxchg - success Monotonic or stricter
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:4:58: error: success atomic ordering must be Monotonic or stricter
test/compile_errors/stage1/obj/atomic_orderings_of_fence_Acquire_or_stricter.zig
@@ -2,6 +2,8 @@ export fn entry() void {
     @fence(.Monotonic);
 }
 
-// atomic orderings of fence Acquire or stricter
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:2:12: error: atomic ordering must be Acquire or stricter
test/compile_errors/stage1/obj/atomicrmw_with_bool_op_not_.Xchg.zig
@@ -3,6 +3,8 @@ export fn entry() void {
     _ = @atomicRmw(bool, &x, .Add, true, .SeqCst);
 }
 
-// atomicrmw with bool op not .Xchg
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:3:30: error: @atomicRmw with bool only allowed with .Xchg
test/compile_errors/stage1/obj/atomicrmw_with_enum_op_not_.Xchg.zig
@@ -9,6 +9,8 @@ export fn entry() void {
     _ = @atomicRmw(E, &x, .Add, .b, .SeqCst);
 }
 
-// atomicrmw with enum op not .Xchg
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:9:27: error: @atomicRmw with enum only allowed with .Xchg
test/compile_errors/stage1/obj/atomicrmw_with_float_op_not_.Xchg_.Add_or_.Sub.zig
@@ -3,6 +3,8 @@ export fn entry() void {
     _ = @atomicRmw(f32, &x, .And, 2, .SeqCst);
 }
 
-// atomicrmw with float op not .Xchg, .Add or .Sub
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:3:29: error: @atomicRmw with float only allowed with .Xchg, .Add and .Sub
test/compile_errors/stage1/obj/attempt_to_cast_enum_literal_to_error.zig
@@ -4,6 +4,8 @@ export fn entry() void {
     }
 }
 
-// attempt to cast enum literal to error
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:3:9: error: expected type 'error{Hi}', found '@Type(.EnumLiteral)'
test/compile_errors/stage1/obj/attempt_to_close_over_comptime_variable_from_outer_scope.zig
@@ -5,7 +5,9 @@ fn SimpleList(comptime L: usize) type {
     };
 }
 
-// attempt to close over comptime variable from outer scope
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:4:19: error: mutable 'T' not accessible from here
 // tmp.zig:2:9: note: declared mutable here
test/compile_errors/stage1/obj/attempt_to_create_17_bit_float_type.zig
@@ -3,6 +3,8 @@ comptime {
     _ = @Type(.{ .Float = .{ .bits = 17 } });
 }
 
-// attempt to create 17 bit float type
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:3:16: error: 17-bit float unsupported
test/compile_errors/stage1/obj/attempt_to_negate_a_non-integer_non-float_or_non-vector_type.zig
@@ -7,6 +7,8 @@ export fn entry() void {
     _ = x;
 }
 
-// attempt to negate a non-integer, non-float or non-vector type
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:6:15: error: negation of type 'anyerror!u32'
test/compile_errors/stage1/obj/attempt_to_use_0_bit_type_in_extern_fn.zig
@@ -9,7 +9,9 @@ export fn entry2() void {
     bar(&{});
 }
 
-// attempt to use 0 bit type in extern fn
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:1:23: error: parameter of type '*void' has 0 bits; not allowed in function with calling convention 'C'
 // tmp.zig:7:11: error: parameter of type '*void' has 0 bits; not allowed in function with calling convention 'C'
test/compile_errors/stage1/obj/attempted_double_ampersand.zig
@@ -5,6 +5,8 @@ export fn entry(a: bool, b: bool) i32 {
     return 5678;
 }
 
-// attempted `&&`
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:2:11: error: ambiguous use of '&&'; use 'and' for logical AND, or change whitespace to ' & &' for bitwise AND
test/compile_errors/stage1/obj/attempted_double_pipe_on_boolean_values.zig
@@ -5,7 +5,9 @@ export fn entry(a: bool, b: bool) i32 {
     return 5678;
 }
 
-// attempted `||` on boolean values
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:2:9: error: expected error set type, found 'bool'
 // tmp.zig:2:11: note: `||` merges error sets; `or` performs boolean OR
test/compile_errors/stage1/obj/attempted_implicit_cast_from_const_T_to_array_len_1_T.zig
@@ -6,7 +6,9 @@ export fn entry(byte: u8) void {
     _ = byte;
 }
 
-// attempted implicit cast from *const T to *[1]T
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:4:22: error: expected type '*[1]i32', found '*const i32'
 // tmp.zig:4:22: note: cast discards const qualifier
test/compile_errors/stage1/obj/attempted_implicit_cast_from_const_T_to_sliceT.zig
@@ -4,6 +4,8 @@ export fn entry() void {
     _ = x;
 }
 
-// attempted implicit cast from *const T to []T
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:3:23: error: expected type '[]u32', found '*const u32'
test/compile_errors/stage1/obj/attempted_implicit_cast_from_T_to_slice_const_T.zig
@@ -3,6 +3,8 @@ export fn entry() void {
     _ = x;
 }
 
-// attempted implicit cast from T to [*]const T
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:2:30: error: expected type '[*]const bool', found 'bool'
test/compile_errors/stage1/obj/bad_alignCast_at_comptime.zig
@@ -4,6 +4,8 @@ comptime {
     _ = aligned;
 }
 
-// bad @alignCast at comptime
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:3:35: error: pointer address 0x1 is not aligned to 4 bytes
test/compile_errors/stage1/obj/bad_alignment_in_asynccall.zig
@@ -0,0 +1,12 @@
+export fn entry() void {
+    var ptr: fn () callconv(.Async) void = func;
+    var bytes: [64]u8 = undefined;
+    _ = @asyncCall(&bytes, {}, ptr, .{});
+}
+fn func() callconv(.Async) void {}
+
+// error
+// backend=stage1
+// target=aarch64-linux-none
+//
+// tmp.zig:4:21: error: expected type '[]align(8) u8', found '*[64]u8'
test/compile_errors/stage1/obj/bad_alignment_in_implicit_cast_from_array_pointer_to_slice.zig
@@ -4,6 +4,8 @@ export fn a() void {
     _ = y;
 }
 
-// bad alignment in implicit cast from array pointer to slice
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:3:30: error: expected type '[]align(16) u8', found '*[10]u8'
test/compile_errors/stage1/obj/bad_alignment_type.zig
@@ -7,7 +7,9 @@ export fn entry2() void {
     _ = x;
 }
 
-// bad alignment type
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:2:20: error: expected type 'u29', found 'bool'
 // tmp.zig:6:19: error: fractional component prevents float value 12.340000 from being casted to type 'u29'
test/compile_errors/stage1/obj/bad_identifier_in_function_with_struct_defined_inside_function_which_references_local_const.zig
@@ -10,6 +10,8 @@ export fn entry() void {
     _ = Block;
 }
 
-// bad identifier in function with struct defined inside function which references local const
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:8:5: error: use of undeclared identifier 'bogus'
test/compile_errors/stage1/obj/bad_import.zig
@@ -1,5 +1,7 @@
 const bogus = @import("bogus-does-not-exist.zig",);
 
-// bad import
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:1:23: error: unable to load '${DIR}bogus-does-not-exist.zig': FileNotFound
test/compile_errors/stage1/obj/bad_usage_of_call.zig
@@ -19,7 +19,9 @@ fn bar() callconv(.Inline) void {}
 fn baz1() void {}
 fn baz2() void {}
 
-// bad usage of @call
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:2:21: error: expected tuple or struct, found 'void'
 // tmp.zig:5:14: error: unable to perform 'never_inline' call at compile-time
test/compile_errors/stage1/obj/bin_and_assign_on_undefined_value.zig
@@ -3,6 +3,8 @@ comptime {
     a &= a;
 }
 
-// bin and assign on undefined value
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:3:5: error: use of undefined value here causes undefined behavior
test/compile_errors/stage1/obj/bin_and_on_undefined_value.zig
@@ -3,6 +3,8 @@ comptime {
     _ = a & a;
 }
 
-// bin and on undefined value
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:3:9: error: use of undefined value here causes undefined behavior
test/compile_errors/stage1/obj/bin_not_on_undefined_value.zig
@@ -3,6 +3,8 @@ comptime {
     _ = ~a;
 }
 
-// bin not on undefined value
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:3:10: error: use of undefined value here causes undefined behavior
test/compile_errors/stage1/obj/bin_or_assign_on_undefined_value.zig
@@ -3,6 +3,8 @@ comptime {
     a |= a;
 }
 
-// bin or assign on undefined value
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:3:5: error: use of undefined value here causes undefined behavior
test/compile_errors/stage1/obj/bin_or_on_undefined_value.zig
@@ -3,6 +3,8 @@ comptime {
     _ = a | a;
 }
 
-// bin or on undefined value
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:3:9: error: use of undefined value here causes undefined behavior
test/compile_errors/stage1/obj/bin_xor_assign_on_undefined_value.zig
@@ -3,6 +3,8 @@ comptime {
     a ^= a;
 }
 
-// bin xor assign on undefined value
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:3:5: error: use of undefined value here causes undefined behavior
test/compile_errors/stage1/obj/bin_xor_on_undefined_value.zig
@@ -3,6 +3,8 @@ comptime {
     _ = a ^ a;
 }
 
-// bin xor on undefined value
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:3:9: error: use of undefined value here causes undefined behavior
test/compile_errors/stage1/obj/binary_not_on_number_literal.zig
@@ -4,6 +4,8 @@ var block_aligned_stuff: usize = (4 + TINY_QUANTUM_SIZE) & ~(TINY_QUANTUM_SIZE -
 
 export fn entry() usize { return @sizeOf(@TypeOf(block_aligned_stuff)); }
 
-// binary not on number literal
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:3:60: error: unable to perform binary not operation on type 'comptime_int'
test/compile_errors/stage1/obj/bit_shifting_only_works_on_integer_types.zig
@@ -3,6 +3,8 @@ export fn entry() void {
     _ = x;
 }
 
-// bit shifting only works on integer types
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:2:16: error: bit shifting operation expected integer type, found '*const u8'
test/compile_errors/stage1/obj/bitCast_same_size_but_bit_count_mismatch.zig
@@ -3,6 +3,8 @@ export fn entry(byte: u8) void {
     _ = oops;
 }
 
-// @bitCast same size but bit count mismatch
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:2:25: error: destination type 'u7' has 7 bits but source type 'u8' has 8 bits
test/compile_errors/stage1/obj/bitCast_to_enum_type.zig
@@ -3,6 +3,8 @@ export fn entry() void {
     _ = y;
 }
 
-// bitCast to enum type
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:2:24: error: cannot cast a value of type 'y'
test/compile_errors/stage1/obj/bitCast_with_different_sizes_inside_an_expression.zig
@@ -3,6 +3,8 @@ export fn entry() void {
     _ = foo;
 }
 
-// @bitCast with different sizes inside an expression
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:2:25: error: destination type 'u8' has size 1 but source type 'f32' has size 4
test/compile_errors/stage1/obj/bogus_compile_var.zig
@@ -1,6 +1,8 @@
 const x = @import("builtin").bogus;
 export fn entry() usize { return @sizeOf(@TypeOf(x)); }
 
-// bogus compile var
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:1:29: error: container 'builtin' has no member called 'bogus'
test/compile_errors/stage1/obj/bogus_method_call_on_slice.zig
@@ -4,6 +4,8 @@ fn f(m: []const u8) void {
 }
 export fn entry() usize { return @sizeOf(@TypeOf(f)); }
 
-// bogus method call on slice
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:3:6: error: no member named 'copy' in '[]const u8'
test/compile_errors/stage1/obj/bool_not_on_undefined_value.zig
@@ -3,6 +3,8 @@ comptime {
     _ = !a;
 }
 
-// bool not on undefined value
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:3:10: error: use of undefined value here causes undefined behavior
test/compile_errors/stage1/obj/branch_on_undefined_value.zig
@@ -2,6 +2,8 @@ const x = if (undefined) true else false;
 
 export fn entry() usize { return @sizeOf(@TypeOf(x)); }
 
-// branch on undefined value
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:1:15: error: use of undefined value here causes undefined behavior
test/compile_errors/stage1/obj/C_pointer_pointing_to_non_C_ABI_compatible_type_or_has_align_attr.zig
@@ -5,6 +5,8 @@ export fn a() void {
     _ = t;
 }
 
-// C pointer pointing to non C ABI compatible type or has align attr
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:3:19: error: C pointers cannot point to non-C-ABI-compatible type 'Foo'
test/compile_errors/stage1/obj/C_pointer_to_anyopaque.zig
@@ -4,6 +4,8 @@ export fn a() void {
     _ = y;
 }
 
-// C pointer to anyopaque
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:3:16: error: C pointers cannot point to opaque types
test/compile_errors/stage1/obj/call_assigned_to_constant.zig
@@ -16,7 +16,9 @@ export fn entry1() void {
     baz = bar(42);
 }
 
-// call assigned to constant
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:12:14: error: cannot assign to constant
 // tmp.zig:16:14: error: cannot assign to constant
test/compile_errors/stage1/obj/call_with_new_stack_on_unsupported_target.zig
@@ -0,0 +1,11 @@
+var buf: [10]u8 align(16) = undefined;
+export fn entry() void {
+    @call(.{ .stack = &buf }, foo, .{});
+}
+fn foo() void {}
+
+// error
+// backend=stage1
+// target=wasm32-wasi-none
+//
+// tmp.zig:3:5: error: target arch 'wasm32' does not support calling with a new stack
test/compile_errors/stage1/obj/callconv_apcs_aapcs_aapcsvfp_on_unsupported_platform.zig
@@ -0,0 +1,11 @@
+export fn entry1() callconv(.APCS) void {}
+export fn entry2() callconv(.AAPCS) void {}
+export fn entry3() callconv(.AAPCSVFP) void {}
+
+// error
+// backend=stage1
+// target=x86_64-linux-none
+//
+// tmp.zig:1:29: error: callconv 'APCS' is only available on ARM, not x86_64
+// tmp.zig:2:29: error: callconv 'AAPCS' is only available on ARM, not x86_64
+// tmp.zig:3:29: error: callconv 'AAPCSVFP' is only available on ARM, not x86_64
test/compile_errors/stage1/obj/callconv_interrupt_on_unsupported_platform.zig
@@ -0,0 +1,7 @@
+export fn entry() callconv(.Interrupt) void {}
+
+// error
+// backend=stage1
+// target=aarch64-linux-none
+//
+// tmp.zig:1:28: error: callconv 'Interrupt' is only available on x86, x86_64, AVR, and MSP430, not aarch64
test/compile_errors/stage1/obj/callconv_signal_on_unsupported_platform.zig
@@ -0,0 +1,7 @@
+export fn entry() callconv(.Signal) void {}
+
+// error
+// backend=stage1
+// target=x86_64-linux-none
+//
+// tmp.zig:1:28: error: callconv 'Signal' is only available on AVR, not x86_64
test/compile_errors/stage1/obj/callconv_stdcall_fastcall_thiscall_on_unsupported_platform-0.zig
@@ -0,0 +1,23 @@
+const F1 = fn () callconv(.Stdcall) void;
+const F2 = fn () callconv(.Fastcall) void;
+const F3 = fn () callconv(.Thiscall) void;
+export fn entry1() void {
+    var a: F1 = undefined;
+    _ = a;
+}
+export fn entry2() void {
+    var a: F2 = undefined;
+    _ = a;
+}
+export fn entry3() void {
+    var a: F3 = undefined;
+    _ = a;
+}
+
+// error
+// backend=stage1
+// target=x86_64-linux-none
+//
+// tmp.zig:1:27: error: callconv 'Stdcall' is only available on x86, not x86_64
+// tmp.zig:2:27: error: callconv 'Fastcall' is only available on x86, not x86_64
+// tmp.zig:3:27: error: callconv 'Thiscall' is only available on x86, not x86_64
test/compile_errors/stage1/obj/callconv_stdcall_fastcall_thiscall_on_unsupported_platform-1.zig
@@ -0,0 +1,11 @@
+export fn entry1() callconv(.Stdcall) void {}
+export fn entry2() callconv(.Fastcall) void {}
+export fn entry3() callconv(.Thiscall) void {}
+
+// error
+// backend=stage1
+// target=x86_64-linux-none
+//
+// tmp.zig:1:29: error: callconv 'Stdcall' is only available on x86, not x86_64
+// tmp.zig:2:29: error: callconv 'Fastcall' is only available on x86, not x86_64
+// tmp.zig:3:29: error: callconv 'Thiscall' is only available on x86, not x86_64
test/compile_errors/stage1/obj/callconv_vectorcall_on_unsupported_platform.zig
@@ -0,0 +1,7 @@
+export fn entry() callconv(.Vectorcall) void {}
+
+// error
+// backend=stage1
+// target=x86_64-linux-none
+//
+// tmp.zig:1:28: error: callconv 'Vectorcall' is only available on x86 and AArch64, not x86_64
test/compile_errors/stage1/obj/calling_a_generic_function_only_known_at_runtime.zig
@@ -7,6 +7,8 @@ pub fn main() !void {
     foos[0](true);
 }
 
-// calling a generic function only known at runtime
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:7:9: error: calling a generic function requires compile-time known function value
test/compile_errors/stage1/obj/calling_function_with_naked_calling_convention.zig
@@ -3,7 +3,9 @@ export fn entry() void {
 }
 fn foo() callconv(.Naked) void { }
 
-// calling function with naked calling convention
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:2:5: error: unable to call function with naked calling convention
 // tmp.zig:4:1: note: declared here
test/compile_errors/stage1/obj/calling_var_args_extern_function_passing_array_instead_of_pointer.zig
@@ -3,6 +3,8 @@ export fn entry() void {
 }
 pub extern fn foo(format: *const u8, ...) void;
 
-// calling var args extern function, passing array instead of pointer
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:2:16: error: expected type '*const u8', found '[5:0]u8'
test/compile_errors/stage1/obj/cannot_break_out_of_defer_expression.zig
@@ -6,6 +6,8 @@ export fn foo() void {
     }
 }
 
-// cannot break out of defer expression
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:4:13: error: cannot break out of defer expression
test/compile_errors/stage1/obj/cannot_continue_out_of_defer_expression.zig
@@ -6,6 +6,8 @@ export fn foo() void {
     }
 }
 
-// cannot continue out of defer expression
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:4:13: error: cannot continue out of defer expression
test/compile_errors/stage1/obj/capture_group_on_switch_prong_with_incompatible_payload_types.zig
@@ -12,7 +12,9 @@ comptime {
     }
 }
 
-// capture group on switch prong with incompatible payload types
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:8:20: error: capture group with incompatible types
 // tmp.zig:8:9: note: type 'usize' here
test/compile_errors/stage1/obj/cast_enum_literal_to_enum_but_it_doesnt_match.zig
@@ -7,7 +7,9 @@ export fn entry() void {
     _ = x;
 }
 
-// cast enum literal to enum but it doesn't match
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:6:20: error: enum 'Foo' has no field named 'c'
 // tmp.zig:1:13: note: 'Foo' declared here
test/compile_errors/stage1/obj/cast_error_union_of_global_error_set_to_error_union_of_smaller_error_set.zig
@@ -7,7 +7,9 @@ fn foo() anyerror!i32 {
     return error.B;
 }
 
-// cast error union of global error set to error union of smaller error set
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:3:35: error: expected type 'SmallErrorSet!i32', found 'anyerror!i32'
 // tmp.zig:3:35: note: error set 'anyerror' cannot cast into error set 'SmallErrorSet'
test/compile_errors/stage1/obj/cast_global_error_set_to_error_set.zig
@@ -7,7 +7,9 @@ fn foo() anyerror {
     return error.B;
 }
 
-// cast global error set to error set
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:3:31: error: expected type 'SmallErrorSet', found 'anyerror'
 // tmp.zig:3:31: note: cannot cast global error set into smaller set
test/compile_errors/stage1/obj/cast_negative_integer_literal_to_usize.zig
@@ -3,6 +3,8 @@ export fn entry() void {
     _ = x;
 }
 
-// cast negative integer literal to usize
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:2:26: error: cannot cast negative value -10 to unsigned integer type 'usize'
test/compile_errors/stage1/obj/cast_negative_value_to_unsigned_integer.zig
@@ -9,7 +9,9 @@ export fn entry1() void {
     _ = unsigned;
 }
 
-// cast negative value to unsigned integer
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:3:22: error: attempt to cast negative value to unsigned integer
 // tmp.zig:8:27: error: cannot cast negative value -1 to unsigned integer type 'u32'
test/compile_errors/stage1/obj/cast_unreachable.zig
@@ -3,7 +3,9 @@ fn f() i32 {
 }
 export fn entry() void { _ = f(); }
 
-// cast unreachable
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:2:12: error: unreachable code
 // tmp.zig:2:21: note: control flow is diverted here
test/compile_errors/stage1/obj/casting_bit_offset_pointer_to_regular_pointer.zig
@@ -14,6 +14,8 @@ fn bar(x: *const u3) u3 {
 
 export fn entry() usize { return @sizeOf(@TypeOf(foo)); }
 
-// casting bit offset pointer to regular pointer
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:8:26: error: expected type '*const u3', found '*align(:3:1) const u3'
test/compile_errors/stage1/obj/catch_on_undefined_value.zig
@@ -3,6 +3,8 @@ comptime {
     _ = a catch false;
 }
 
-// catch on undefined value
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:3:11: error: use of undefined value here causes undefined behavior
test/compile_errors/stage1/obj/chained_comparison_operators.zig
@@ -2,6 +2,8 @@ export fn a(value: u32) bool {
     return 1 < value < 1000;
 }
 
-// chained comparison operators
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:2:22: error: comparison operators cannot be chained
test/compile_errors/stage1/obj/cImport_with_bogus_include.zig
@@ -1,7 +1,9 @@
 const c = @cImport(@cInclude("bogus.h"));
 export fn entry() usize { return @sizeOf(@TypeOf(c.bogo)); }
 
-// @cImport with bogus include
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:1:11: error: C import failed
 // .h:1:10: note: 'bogus.h' file not found
test/compile_errors/stage1/obj/cmpxchg_with_float.zig
@@ -3,6 +3,8 @@ export fn entry() void {
     _ = @cmpxchgWeak(f32, &x, 1, 2, .SeqCst, .SeqCst);
 }
 
-// cmpxchg with float
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:3:22: error: expected bool, integer, enum or pointer type, found 'f32'
test/compile_errors/stage1/obj/colliding_invalid_top_level_functions.zig
@@ -2,7 +2,9 @@ fn func() bogus {}
 fn func() bogus {}
 export fn entry() usize { return @sizeOf(@TypeOf(func)); }
 
-// colliding invalid top level functions
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:2:1: error: redeclaration of 'func'
 // tmp.zig:1:1: note: other declaration here
test/compile_errors/stage1/obj/compare_optional_to_non-optional_with_invalid_types.zig
@@ -22,7 +22,9 @@ export fn invalidChildType() void {
     _ = (x == y);
 }
 
-// compare optional to non-optional with invalid types
+// error
+// backend=stage1
+// target=native
 //
 // :4:12: error: cannot compare types '?i32' and 'comptime_int'
 // :4:12: note: optional child type 'i32' must be the same as non-optional type 'comptime_int'
test/compile_errors/stage1/obj/comparing_a_non-optional_pointer_against_null.zig
@@ -3,6 +3,8 @@ export fn entry() void {
     _ = &x == null;
 }
 
-// comparing a non-optional pointer against null
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:3:12: error: comparison of '*i32' with null
test/compile_errors/stage1/obj/comparing_against_undefined_produces_undefined_value.zig
@@ -2,6 +2,8 @@ export fn entry() void {
     if (2 == undefined) {}
 }
 
-// comparing against undefined produces undefined value
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:2:11: error: use of undefined value here causes undefined behavior
test/compile_errors/stage1/obj/comparison_operators_with_undefined_value.zig
@@ -35,7 +35,9 @@ comptime {
     if (a <= a) x += 1;
 }
 
-// comparison operators with undefined value
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:5:11: error: use of undefined value here causes undefined behavior
 // tmp.zig:11:11: error: use of undefined value here causes undefined behavior
test/compile_errors/stage1/obj/comparison_with_error_union_and_error_value.zig
@@ -3,6 +3,8 @@ export fn entry() void {
     _ = number_or_error == error.SomethingAwful;
 }
 
-// comparison with error union and error value
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:3:25: error: operator not allowed for type 'anyerror!i32'
test/compile_errors/stage1/obj/compile-time_division_by_zero.zig
@@ -5,6 +5,8 @@ comptime {
     _ = c;
 }
 
-// compile-time division by zero
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:4:17: error: division by zero
test/compile_errors/stage1/obj/compile-time_remainder_division_by_zero.zig
@@ -5,6 +5,8 @@ comptime {
     _ = c;
 }
 
-// compile-time remainder division by zero
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:4:17: error: division by zero
test/compile_errors/stage1/obj/compile_error_in_struct_init_expression.zig
@@ -9,6 +9,8 @@ export fn entry() void {
     _ = x;
 }
 
-// compile error in struct init expression
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:2:14: error: use of undeclared identifier 'crap'
test/compile_errors/stage1/obj/compile_error_when_evaluating_return_type_of_inferred_error_set.zig
@@ -7,6 +7,8 @@ export fn entry() void {
     _ = car;
 }
 
-// compile error when evaluating return type of inferred error set
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:2:11: error: use of undeclared identifier 'SymbolThatDoesNotExist'
test/compile_errors/stage1/obj/compile_log.zig
@@ -7,7 +7,9 @@ fn bar(a: i32, b: []const u8) void {
     @compileLog("end",);
 }
 
-// compile log
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:5:5: error: found compile log statement
 // tmp.zig:6:5: error: found compile log statement
test/compile_errors/stage1/obj/compile_log_a_pointer_to_an_opaque_value.zig
@@ -2,6 +2,8 @@ export fn entry() void {
     @compileLog(@ptrCast(*const anyopaque, &entry));
 }
 
-// compile log a pointer to an opaque value
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:2:5: error: found compile log statement
test/compile_errors/stage1/obj/compile_log_statement_inside_function_which_must_be_comptime_evaluated.zig
@@ -7,6 +7,8 @@ export fn entry() void {
     _ = @typeName(Foo(i32));
 }
 
-// compile log statement inside function which must be comptime evaluated
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:2:5: error: found compile log statement
test/compile_errors/stage1/obj/compile_log_statement_warning_deduplication_in_generic_fn.zig
@@ -7,6 +7,8 @@ fn inner(comptime n: usize) void {
     inline while (i < n) : (i += 1) { @compileLog("!@#$"); }
 }
 
-// compile log statement warning deduplication in generic fn
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:7:39: error: found compile log statement
test/compile_errors/stage1/obj/compile_time_division_by_zero.zig
@@ -5,6 +5,8 @@ fn foo(x: u32) u32 {
 
 export fn entry() usize { return @sizeOf(@TypeOf(y)); }
 
-// compile time division by zero
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:3:14: error: division by zero
test/compile_errors/stage1/obj/compileError_shows_traceback_of_references_that_caused_it.zig
@@ -7,6 +7,8 @@ export fn entry() i32 {
     return bar;
 }
 
-// @compileError shows traceback of references that caused it
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:1:13: error: aoeu
test/compile_errors/stage1/obj/compileLog_of_tagged_enum_doesnt_crash_the_compiler.zig
@@ -10,6 +10,8 @@ pub fn main () void {
     comptime testCompileLog(Bar{.X = 123});
 }
 
-// compileLog of tagged enum doesn't crash the compiler
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:6:5: error: found compile log statement
test/compile_errors/stage1/obj/comptime_cast_enum_to_union_but_field_has_payload.zig
@@ -9,7 +9,9 @@ export fn entry() void {
     _ = x;
 }
 
-// comptime cast enum to union but field has payload
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:8:26: error: cast to union 'Value' must initialize 'i32' field 'A'
 // tmp.zig:3:5: note: field 'A' declared here
test/compile_errors/stage1/obj/comptime_continue_inside_runtime_catch.zig
@@ -8,7 +8,9 @@ fn bad() !void {
     return error.Bad;
 }
 
-// comptime continue inside runtime catch
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:4:21: error: comptime control flow inside runtime block
 // tmp.zig:4:15: note: runtime block created here
test/compile_errors/stage1/obj/comptime_continue_inside_runtime_if_bool.zig
@@ -7,7 +7,9 @@ export fn entry() void {
     }
 }
 
-// comptime continue inside runtime if bool
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:5:22: error: comptime control flow inside runtime block
 // tmp.zig:5:9: note: runtime block created here
test/compile_errors/stage1/obj/comptime_continue_inside_runtime_if_error.zig
@@ -7,7 +7,9 @@ export fn entry() void {
     }
 }
 
-// comptime continue inside runtime if error
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:5:20: error: comptime control flow inside runtime block
 // tmp.zig:5:9: note: runtime block created here
test/compile_errors/stage1/obj/comptime_continue_inside_runtime_if_optional.zig
@@ -7,7 +7,9 @@ export fn entry() void {
     }
 }
 
-// comptime continue inside runtime if optional
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:5:20: error: comptime control flow inside runtime block
 // tmp.zig:5:9: note: runtime block created here
test/compile_errors/stage1/obj/comptime_continue_inside_runtime_switch.zig
@@ -10,7 +10,9 @@ export fn entry() void {
     }
 }
 
-// comptime continue inside runtime switch
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:6:19: error: comptime control flow inside runtime block
 // tmp.zig:5:9: note: runtime block created here
test/compile_errors/stage1/obj/comptime_continue_inside_runtime_while_bool.zig
@@ -7,7 +7,9 @@ export fn entry() void {
     }
 }
 
-// comptime continue inside runtime while bool
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:5:25: error: comptime control flow inside runtime block
 // tmp.zig:5:9: note: runtime block created here
test/compile_errors/stage1/obj/comptime_continue_inside_runtime_while_error.zig
@@ -9,7 +9,9 @@ export fn entry() void {
     }
 }
 
-// comptime continue inside runtime while error
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:6:13: error: comptime control flow inside runtime block
 // tmp.zig:5:9: note: runtime block created here
test/compile_errors/stage1/obj/comptime_continue_inside_runtime_while_optional.zig
@@ -7,7 +7,9 @@ export fn entry() void {
     }
 }
 
-// comptime continue inside runtime while optional
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:5:23: error: comptime control flow inside runtime block
 // tmp.zig:5:9: note: runtime block created here
test/compile_errors/stage1/obj/comptime_float_in_asm_input.zig
@@ -2,6 +2,8 @@ export fn foo() void {
     asm volatile ("" : : [bar]"r"(3.17) : "");
 }
 
-// comptime_float in asm input
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:2:35: error: expected sized integer or sized float, found comptime_float
test/compile_errors/stage1/obj/comptime_implicit_cast_f64_to_f32.zig
@@ -4,6 +4,8 @@ export fn entry() void {
     _ = y;
 }
 
-// comptime implicit cast f64 to f32
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:3:20: error: cast of value 16777217.000000 to type 'f32' loses information
test/compile_errors/stage1/obj/comptime_int_in_asm_input.zig
@@ -2,6 +2,8 @@ export fn foo() void {
     asm volatile ("" : : [bar]"r"(3) : "");
 }
 
-// comptime_int in asm input
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:2:35: error: expected sized integer or sized float, found comptime_int
test/compile_errors/stage1/obj/comptime_ptrcast_of_zero-sized_type.zig
@@ -5,6 +5,8 @@ fn foo() void {
 }
 comptime { foo(); }
 
-// comptime ptrcast of zero-sized type
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:3:21: error: '*const struct:2:17' and '[*]const u8' do not have the same in-memory representation
test/compile_errors/stage1/obj/comptime_slice-sentinel_does_not_match_memory_at_target_index_terminated.zig
@@ -54,7 +54,9 @@ export fn foo_slice() void {
     }
 }
 
-// comptime slice-sentinel does not match memory at target index (terminated)
+// error
+// backend=stage1
+// target=native
 //
 // :4:29: error: slice-sentinel does not match memory at target index
 // :12:29: error: slice-sentinel does not match memory at target index
test/compile_errors/stage1/obj/comptime_slice-sentinel_does_not_match_memory_at_target_index_unterminated.zig
@@ -54,7 +54,9 @@ export fn foo_slice() void {
     }
 }
 
-// comptime slice-sentinel does not match memory at target index (unterminated)
+// error
+// backend=stage1
+// target=native
 //
 // :4:29: error: slice-sentinel does not match memory at target index
 // :12:29: error: slice-sentinel does not match memory at target index
test/compile_errors/stage1/obj/comptime_slice-sentinel_does_not_match_target-sentinel.zig
@@ -54,7 +54,9 @@ export fn foo_slice() void {
     }
 }
 
-// comptime slice-sentinel does not match target-sentinel
+// error
+// backend=stage1
+// target=native
 //
 // :4:29: error: slice-sentinel does not match target-sentinel
 // :12:29: error: slice-sentinel does not match target-sentinel
test/compile_errors/stage1/obj/comptime_slice-sentinel_is_out_of_bounds_terminated.zig
@@ -54,7 +54,9 @@ export fn foo_slice() void {
     }
 }
 
-// comptime slice-sentinel is out of bounds (terminated)
+// error
+// backend=stage1
+// target=native
 //
 // :4:29: error: out of bounds slice
 // :12:29: error: out of bounds slice
test/compile_errors/stage1/obj/comptime_slice-sentinel_is_out_of_bounds_unterminated.zig
@@ -54,7 +54,9 @@ export fn foo_slice() void {
     }
 }
 
-// comptime slice-sentinel is out of bounds (unterminated)
+// error
+// backend=stage1
+// target=native
 //
 // :4:29: error: slice-sentinel is out of bounds
 // :12:29: error: slice-sentinel is out of bounds
test/compile_errors/stage1/obj/comptime_slice_of_an_undefined_slice.zig
@@ -4,6 +4,8 @@ comptime {
     _ = b;
 }
 
-// comptime slice of an undefined slice
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:3:14: error: slice of undefined
test/compile_errors/stage1/obj/comptime_slice_of_undefined_pointer_non-zero_len.zig
@@ -3,6 +3,8 @@ export fn entry() void {
     _ = slice;
 }
 
-// comptime slice of undefined pointer non-zero len
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:2:41: error: non-zero length slice of undefined pointer
test/compile_errors/stage1/obj/comptime_struct_field_no_init_value.zig
@@ -6,6 +6,8 @@ export fn entry() void {
     _ = f;
 }
 
-// comptime struct field, no init value
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:2:5: error: comptime field without default initialization value
test/compile_errors/stage1/obj/const_frame_cast_to_anyframe.zig
@@ -11,7 +11,9 @@ fn func() void {
     suspend {}
 }
 
-// const frame cast to anyframe
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:3:12: error: expected type 'anyframe', found '*const @Frame(func)'
 // tmp.zig:7:24: error: expected type 'anyframe', found '*const @Frame(func)'
test/compile_errors/stage1/obj/const_is_a_statement_not_an_expression.zig
@@ -2,6 +2,8 @@ export fn f() void {
     (const a = 0);
 }
 
-// const is a statement, not an expression
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:2:6: error: expected expression, found 'const'
test/compile_errors/stage1/obj/container_init_with_non-type.zig
@@ -3,6 +3,8 @@ const a = zero{1};
 
 export fn entry() usize { return @sizeOf(@TypeOf(a)); }
 
-// container init with non-type
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:2:11: error: expected type 'type', found 'i32'
test/compile_errors/stage1/obj/control_flow_uses_comptime_var_at_runtime.zig
@@ -7,7 +7,9 @@ export fn foo() void {
 
 fn bar() void { }
 
-// control flow uses comptime var at runtime
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:3:5: error: control flow attempts to use compile-time variable at runtime
 // tmp.zig:3:24: note: compile-time variable assigned here
test/compile_errors/stage1/obj/control_reaches_end_of_non-void_function.zig
@@ -1,6 +1,8 @@
 fn a() i32 {}
 export fn entry() void { _ = a(); }
 
-// control reaches end of non-void function
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:1:12: error: expected type 'i32', found 'void'
test/compile_errors/stage1/obj/declaration_between_fields.zig
@@ -15,7 +15,9 @@ comptime {
     _ = S;
 }
 
-// declaration between fields
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:9:5: error: declarations are not allowed between container fields
 // tmp.zig:5:5: note: field before declarations here
test/compile_errors/stage1/obj/declaration_with_same_name_as_primitive_must_use_special_syntax.zig
@@ -4,7 +4,9 @@ export fn entry() void {
     _ = a;
 }
 
-// declaration with same name as primitive must use special syntax
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:1:7: error: name shadows primitive 'u8'
 // tmp.zig:1:7: note: consider using @"u8" to disambiguate
test/compile_errors/stage1/obj/deduplicate_undeclared_identifier.zig
@@ -5,6 +5,8 @@ export fn b() void {
     x += 1;
 }
 
-// deduplicate undeclared identifier
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:2:5: error: use of undeclared identifier 'x'
test/compile_errors/stage1/obj/deref_on_undefined_value.zig
@@ -3,6 +3,8 @@ comptime {
     _ = a.*;
 }
 
-// deref on undefined value
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:3:9: error: attempt to dereference undefined value
test/compile_errors/stage1/obj/deref_slice_and_get_len_field.zig
@@ -3,6 +3,8 @@ export fn entry() void {
     _ = a.*.len;
 }
 
-// deref slice and get len field
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:3:10: error: attempt to dereference non-pointer type '[]u8'
test/compile_errors/stage1/obj/dereference_an_array.zig
@@ -7,6 +7,8 @@ pub fn pass(in: []u8) []u8 {
 
 export fn entry() usize { return @sizeOf(@TypeOf(pass)); }
 
-// dereference an array
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:4:10: error: attempt to dereference non-pointer type '[10]u8'
test/compile_errors/stage1/obj/dereference_unknown_length_pointer.zig
@@ -2,6 +2,8 @@ export fn entry(x: [*]i32) i32 {
     return x.*;
 }
 
-// dereference unknown length pointer
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:2:13: error: index syntax required for unknown-length pointer type '[*]i32'
test/compile_errors/stage1/obj/direct_struct_loop.zig
@@ -1,6 +1,8 @@
 const A = struct { a : A, };
 export fn entry() usize { return @sizeOf(A); }
 
-// direct struct loop
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:1:11: error: struct 'A' depends on itself
test/compile_errors/stage1/obj/directly_embedding_opaque_type_in_struct_and_union.zig
@@ -20,7 +20,9 @@ export fn c() void {
     _ = qux;
 }
 
-// directly embedding opaque type in struct and union
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:3:5: error: opaque types have unknown size and therefore cannot be directly embedded in structs
 // tmp.zig:7:5: error: opaque types have unknown size and therefore cannot be directly embedded in unions
test/compile_errors/stage1/obj/disallow_coercion_from_non-null-terminated_pointer_to_null-terminated_pointer.zig
@@ -5,6 +5,8 @@ pub fn main() void {
     _ = puts(no_zero_ptr);
 }
 
-// disallow coercion from non-null-terminated pointer to null-terminated pointer
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:5:14: error: expected type '[*:0]const u8', found '[*]const u8'
test/compile_errors/stage1/obj/discarding_error_value.zig
@@ -5,6 +5,8 @@ fn foo() !void {
     return error.OutOfMemory;
 }
 
-// discarding error value
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:2:12: error: error is discarded. consider using `try`, `catch`, or `if`
test/compile_errors/stage1/obj/div_assign_on_undefined_value.zig
@@ -3,6 +3,8 @@ comptime {
     a /= a;
 }
 
-// div assign on undefined value
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:3:5: error: use of undefined value here causes undefined behavior
test/compile_errors/stage1/obj/div_on_undefined_value.zig
@@ -3,6 +3,8 @@ comptime {
     _ = a / a;
 }
 
-// div on undefined value
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:3:9: error: use of undefined value here causes undefined behavior
test/compile_errors/stage1/obj/division_by_zero.zig
@@ -8,7 +8,9 @@ export fn entry2() usize { return @sizeOf(@TypeOf(lit_float_x)); }
 export fn entry3() usize { return @sizeOf(@TypeOf(int_x)); }
 export fn entry4() usize { return @sizeOf(@TypeOf(float_x)); }
 
-// division by zero
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:1:21: error: division by zero
 // tmp.zig:2:25: error: division by zero
test/compile_errors/stage1/obj/dont_implicit_cast_double_pointer_to_anyopaque.zig
@@ -6,6 +6,8 @@ export fn entry() void {
     _ = ptr2;
 }
 
-// don't implicit cast double pointer to *anyopaque
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:5:29: error: expected type '*anyopaque', found '**u32'
test/compile_errors/stage1/obj/double_optional_on_main_return_value.zig
@@ -1,6 +1,8 @@
 pub fn main() ??void {
 }
 
-// double ?? on main return value
+// error
+// backend=stage1
+// target=native
 //
 // error: expected return type of main to be 'void', '!void', 'noreturn', 'u8', or '!u8'
test/compile_errors/stage1/obj/duplicate_boolean_switch_value.zig
@@ -15,7 +15,9 @@ comptime {
     _ = x;
 }
 
-// duplicate boolean switch value
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:5:9: error: duplicate switch value
 // tmp.zig:13:9: error: duplicate switch value
test/compile_errors/stage1/obj/duplicate_enum_field.zig
@@ -8,7 +8,9 @@ export fn entry() void {
     _ = a;
 }
 
-// duplicate enum field
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:3:5: error: duplicate enum field: 'Bar'
 // tmp.zig:2:5: note: other field here
test/compile_errors/stage1/obj/duplicate_error_in_switch.zig
@@ -14,7 +14,9 @@ fn foo(x: i32) !void {
     }
 }
 
-// duplicate error in switch
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:5:14: error: duplicate switch value: '@typeInfo(@typeInfo(@TypeOf(foo)).Fn.return_type.?).ErrorUnion.error_set.Foo'
 // tmp.zig:3:14: note: other value here
test/compile_errors/stage1/obj/duplicate_error_value_in_error_set.zig
@@ -7,7 +7,9 @@ export fn entry() void {
     _ = a;
 }
 
-// duplicate error value in error set
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:3:5: error: duplicate error set field 'Bar'
 // tmp.zig:2:5: note: previous declaration here
test/compile_errors/stage1/obj/duplicate_field_in_struct_value_expression.zig
@@ -13,6 +13,8 @@ export fn f() void {
     _ = a;
 }
 
-// duplicate field in struct value expression
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:11:9: error: duplicate field
test/compile_errors/stage1/obj/duplicate_struct_field.zig
@@ -7,7 +7,9 @@ export fn entry() void {
     _ = a;
 }
 
-// duplicate struct field
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:3:5: error: duplicate struct field: 'Bar'
 // tmp.zig:2:5: note: other field here
test/compile_errors/stage1/obj/duplicate_union_field.zig
@@ -7,7 +7,9 @@ export fn entry() void {
     _ = a;
 }
 
-// duplicate union field
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:3:5: error: duplicate union field: 'Bar'
 // tmp.zig:2:5: note: other field here
test/compile_errors/stage1/obj/embedFile_with_bogus_file.zig
@@ -2,6 +2,8 @@ const resource = @embedFile("bogus.txt",);
 
 export fn entry() usize { return @sizeOf(@TypeOf(resource)); }
 
-// @embedFile with bogus file
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:1:29: error: unable to find '
test/compile_errors/stage1/obj/empty_for_loop_body.zig
@@ -2,6 +2,8 @@ export fn a() void {
     for(undefined) |x|;
 }
 
-// empty for loop body
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:2:23: error: expected block or assignment, found ';'
test/compile_errors/stage1/obj/empty_if_body.zig
@@ -2,6 +2,8 @@ export fn a() void {
     if(true);
 }
 
-// empty if body
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:2:13: error: expected block or assignment, found ';'
test/compile_errors/stage1/obj/empty_switch_on_an_integer.zig
@@ -3,6 +3,8 @@ export fn entry() void {
     switch(x) {}
 }
 
-// empty switch on an integer
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:3:5: error: switch must handle all possibilities
test/compile_errors/stage1/obj/empty_while_loop_body.zig
@@ -2,6 +2,8 @@ export fn a() void {
     while(true);
 }
 
-// empty while loop body
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:2:16: error: expected block or assignment, found ';'
test/compile_errors/stage1/obj/endless_loop_in_function_evaluation.zig
@@ -5,6 +5,8 @@ fn fibonacci(x: i32) i32 {
 
 export fn entry() usize { return @sizeOf(@TypeOf(seventh_fib_number)); }
 
-// endless loop in function evaluation
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:3:21: error: evaluation exceeded 1000 backwards branches
test/compile_errors/stage1/obj/enum_field_value_references_enum.zig
@@ -8,6 +8,8 @@ export fn entry() void {
 }
 const D = 1;
 
-// enum field value references enum
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:1:17: error: enum 'Foo' depends on itself
test/compile_errors/stage1/obj/enum_in_field_count_range_but_not_matching_tag.zig
@@ -7,7 +7,9 @@ export fn entry() void {
     _ = x;
 }
 
-// enum in field count range but not matching tag
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:6:13: error: enum 'Foo' has no tag matching integer value 0
 // tmp.zig:1:13: note: 'Foo' declared here
test/compile_errors/stage1/obj/enum_value_already_taken.zig
@@ -10,7 +10,9 @@ export fn entry() void {
     _ = x;
 }
 
-// enum value already taken
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:6:5: error: enum tag value 60 already taken
 // tmp.zig:4:5: note: other occurrence here
test/compile_errors/stage1/obj/enum_with_0_fields.zig
@@ -1,5 +1,7 @@
 const Foo = enum {};
 
-// enum with 0 fields
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:1:13: error: enum declarations must have at least one tag
test/compile_errors/stage1/obj/enum_with_declarations_unavailable_for_reify_type.zig
@@ -2,6 +2,8 @@ export fn entry() void {
     _ = @Type(@typeInfo(enum { foo, const bar = 1; }));
 }
 
-// enum with declarations unavailable for @Type
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:2:15: error: Type.Enum.decls must be empty for @Type
test/compile_errors/stage1/obj/error_equality_but_sets_have_no_common_members.zig
@@ -9,6 +9,8 @@ fn foo(x: Set1) void {
     }
 }
 
-// error equality but sets have no common members
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:7:11: error: error sets 'Set1' and 'Set2' have no common errors
test/compile_errors/stage1/obj/error_not_handled_in_switch.zig
@@ -12,7 +12,9 @@ fn foo(x: i32) !void {
     }
 }
 
-// error not handled in switch
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:2:26: error: error.Baz not handled in switch
 // tmp.zig:2:26: error: error.Bar not handled in switch
test/compile_errors/stage1/obj/error_note_for_function_parameter_incompatibility.zig
@@ -4,7 +4,9 @@ export fn entry() void {
     do_the_thing(bar);
 }
 
-// error note for function parameter incompatibility
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:4:18: error: expected type 'fn(i32) void', found 'fn(bool) void
 // tmp.zig:4:18: note: parameter 0: 'bool' cannot cast into 'i32'
test/compile_errors/stage1/obj/error_union_operator_with_non_error_set_LHS.zig
@@ -4,6 +4,8 @@ comptime {
     _ = x;
 }
 
-// error union operator with non error set LHS
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:2:15: error: expected error set type, found type 'i32'
test/compile_errors/stage1/obj/error_when_evaluating_return_type.zig
@@ -10,6 +10,8 @@ export fn entry() void {
     _ = rule_set;
 }
 
-// error when evaluating return type
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:2:19: error: expected type 'i32', found 'type'
test/compile_errors/stage1/obj/exceeded_maximum_bit_width_of_integer.zig
@@ -7,7 +7,9 @@ export fn entry2() void {
     _ = x;
 }
 
-// exceeded maximum bit width of integer
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:2:15: error: primitive integer type 'u65536' exceeds maximum bit width of 65535
 // tmp.zig:6:12: error: primitive integer type 'i65536' exceeds maximum bit width of 65535
test/compile_errors/stage1/obj/explicit_cast_float_literal_to_integer_when_there_is_a_fraction_component.zig
@@ -2,6 +2,8 @@ export fn entry() i32 {
     return @as(i32, 12.34);
 }
 
-// explicit cast float literal to integer when there is a fraction component
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:2:21: error: fractional component prevents float value 12.340000 from being casted to type 'i32'
test/compile_errors/stage1/obj/explicit_error_set_cast_known_at_comptime_violates_error_sets.zig
@@ -6,6 +6,8 @@ comptime {
     _ = y;
 }
 
-// explicit error set cast known at comptime violates error sets
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:5:13: error: error.B not a member of error set 'Set2'
test/compile_errors/stage1/obj/explicitly_casting_non_tag_type_to_enum.zig
@@ -11,6 +11,8 @@ export fn entry() void {
     _ = x;
 }
 
-// explicitly casting non tag type to enum
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:10:31: error: expected integer type, found 'f32'
test/compile_errors/stage1/obj/export_function_with_comptime_parameter.zig
@@ -2,6 +2,8 @@ export fn foo(comptime x: i32, y: i32) i32{
     return x + y;
 }
 
-// export function with comptime parameter
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:1:15: error: comptime parameter not allowed in function with calling convention 'C'
test/compile_errors/stage1/obj/export_generic_function.zig
@@ -3,6 +3,8 @@ export fn foo(num: anytype) i32 {
     return 0;
 }
 
-// export generic function
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:1:15: error: parameter of type 'anytype' not allowed in function with calling convention 'C'
test/compile_errors/stage1/obj/exported_async_function.zig
@@ -1,5 +1,7 @@
 export fn foo() callconv(.Async) void {}
 
-// exported async function
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:1:1: error: exported function cannot be async
test/compile_errors/stage1/obj/exported_enum_without_explicit_integer_tag_type.zig
@@ -7,7 +7,9 @@ comptime {
     @export(e, .{ .name = "e" });
 }
 
-// exported enum without explicit integer tag type
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:3:13: error: exported enum without explicit integer tag type
 // tmp.zig:7:13: error: exported enum value without explicit integer tag type
test/compile_errors/stage1/obj/extern_function_pointer_mismatch.zig
@@ -5,6 +5,8 @@ export fn c(x: i32) i32 {return x + 2;}
 
 export fn entry() usize { return @sizeOf(@TypeOf(fns)); }
 
-// extern function pointer mismatch
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:1:37: error: expected type 'fn(i32) i32', found 'fn(i32) callconv(.C) i32'
test/compile_errors/stage1/obj/extern_function_with_comptime_parameter.zig
@@ -4,6 +4,8 @@ fn f() i32 {
 }
 export fn entry() usize { return @sizeOf(@TypeOf(f)); }
 
-// extern function with comptime parameter
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:1:15: error: comptime parameter not allowed in function with calling convention 'C'
test/compile_errors/stage1/obj/extern_struct_with_extern-compatible_but_inferred_integer_tag_type.zig
@@ -36,6 +36,8 @@ export fn entry() void {
     _ = s;
 }
 
-// extern struct with extern-compatible but inferred integer tag type
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:31:5: error: extern structs cannot contain fields of type 'E'
test/compile_errors/stage1/obj/extern_struct_with_non-extern-compatible_integer_tag_type.zig
@@ -7,6 +7,8 @@ export fn entry() void {
     _ = s;
 }
 
-// extern struct with non-extern-compatible integer tag type
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:3:5: error: extern structs cannot contain fields of type 'E'
test/compile_errors/stage1/obj/extern_union_field_missing_type.zig
@@ -6,6 +6,8 @@ export fn entry() void {
     _ = a;
 }
 
-// extern union field missing type
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:2:5: error: union field missing type
test/compile_errors/stage1/obj/extern_union_given_enum_tag_type.zig
@@ -13,6 +13,8 @@ export fn entry() void {
     _ = a;
 }
 
-// extern union given enum tag type
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:6:30: error: extern union does not support enum tag type
test/compile_errors/stage1/obj/extern_variable_has_no_type.zig
@@ -3,6 +3,8 @@ pub export fn entry() void {
     foo;
 }
 
-// extern variable has no type
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:1:8: error: unable to infer variable type
test/compile_errors/stage1/obj/field_access_of_opaque_type.zig
@@ -9,6 +9,8 @@ fn bar(x: *MyType) bool {
     return x.blah;
 }
 
-// field access of opaque type
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:9:13: error: no member named 'blah' in opaque type 'MyType'
test/compile_errors/stage1/obj/field_access_of_slices.zig
@@ -4,6 +4,8 @@ export fn entry() void {
     _ = info;
 }
 
-// field access of slices
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:3:32: error: type 'type' does not support field access
test/compile_errors/stage1/obj/field_access_of_unknown_length_pointer.zig
@@ -6,6 +6,8 @@ export fn entry(foo: [*]Foo) void {
     foo.a += 1;
 }
 
-// field access of unknown length pointer
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:6:8: error: type '[*]Foo' does not support field access
test/compile_errors/stage1/obj/field_type_supplied_in_an_enum.zig
@@ -4,7 +4,9 @@ const Letter = enum {
     C,
 };
 
-// field type supplied in an enum
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:2:8: error: enum fields do not have types
 // tmp.zig:1:16: note: consider 'union(enum)' here to make it a tagged union
test/compile_errors/stage1/obj/fieldParentPtr-bad_field_name.zig
@@ -5,6 +5,8 @@ export fn foo(a: *i32) *Foo {
     return @fieldParentPtr(Foo, "a", a);
 }
 
-// @fieldParentPtr - bad field name
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:5:33: error: struct 'Foo' has no field 'a'
test/compile_errors/stage1/obj/fieldParentPtr-comptime_field_ptr_not_based_on_struct.zig
@@ -10,6 +10,8 @@ comptime {
     _ = another_foo_ptr;
 }
 
-// @fieldParentPtr - comptime field ptr not based on struct
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:9:55: error: pointer value not based on parent struct
test/compile_errors/stage1/obj/fieldParentPtr-comptime_wrong_field_index.zig
@@ -9,6 +9,8 @@ comptime {
     _ = another_foo_ptr;
 }
 
-// @fieldParentPtr - comptime wrong field index
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:8:29: error: field 'b' has index 1 but pointer value is index 0 of struct 'Foo'
test/compile_errors/stage1/obj/fieldParentPtr-field_pointer_is_not_pointer.zig
@@ -5,6 +5,8 @@ export fn foo(a: i32) *Foo {
     return @fieldParentPtr(Foo, "a", a);
 }
 
-// @fieldParentPtr - field pointer is not pointer
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:5:38: error: expected pointer, found 'i32'
test/compile_errors/stage1/obj/fieldParentPtr-non_struct.zig
@@ -3,6 +3,8 @@ export fn foo(a: *i32) *Foo {
     return @fieldParentPtr(Foo, "a", a);
 }
 
-// @fieldParentPtr - non struct
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:3:28: error: expected struct type, found 'i32'
test/compile_errors/stage1/obj/float_literal_too_large_error.zig
@@ -3,6 +3,8 @@ comptime {
     _ = a;
 }
 
-// float literal too large error
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:2:15: error: float literal out of range of any type
test/compile_errors/stage1/obj/float_literal_too_small_error_denormal.zig
@@ -3,6 +3,8 @@ comptime {
     _ = a;
 }
 
-// float literal too small error (denormal)
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:2:15: error: float literal out of range of any type
test/compile_errors/stage1/obj/floatToInt_comptime_safety.zig
@@ -8,7 +8,9 @@ comptime {
     _ = @floatToInt(u8, @as(f32, 256.1));
 }
 
-// @floatToInt comptime safety
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:2:9: error: integer value '-129' cannot be stored in type 'i8'
 // tmp.zig:5:9: error: integer value '-1' cannot be stored in type 'u8'
test/compile_errors/stage1/obj/for_loop_body_expression_ignored.zig
@@ -10,7 +10,9 @@ export fn f2() void {
     _ = x;
 }
 
-// for loop body expression ignored
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:5:30: error: expression value is ignored
 // tmp.zig:9:30: error: expression value is ignored
test/compile_errors/stage1/obj/frame_called_outside_of_function_definition.zig
@@ -4,6 +4,8 @@ export fn entry() bool {
     return handle_undef == handle_dummy;
 }
 
-// @frame() called outside of function definition
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:2:30: error: @frame() called outside of function definition
test/compile_errors/stage1/obj/frame_causes_function_to_be_async.zig
@@ -5,7 +5,9 @@ fn func() void {
     _ = @frame();
 }
 
-// @frame() causes function to be async
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:1:1: error: function with calling convention 'C' cannot be async
 // tmp.zig:5:9: note: @frame() causes function to be async
test/compile_errors/stage1/obj/Frame_of_generic_function.zig
@@ -7,6 +7,8 @@ fn func(comptime T: type) void {
     _ = x;
 }
 
-// @Frame() of generic function
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:2:16: error: @Frame() of generic function
test/compile_errors/stage1/obj/function_alignment_non_power_of_2.zig
@@ -1,6 +1,8 @@
 extern fn foo() align(3) void;
 export fn entry() void { return foo(); }
 
-// function alignment non power of 2
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:1:23: error: alignment value 3 is not a power of 2
test/compile_errors/stage1/obj/function_call_assigned_to_incorrect_type.zig
@@ -6,6 +6,8 @@ fn concat() [16]f32 {
     return [1]f32{0}**16;
 }
 
-// function call assigned to incorrect type
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:3:17: error: expected type '[4]f32', found '[16]f32'
test/compile_errors/stage1/obj/function_parameter_is_opaque.zig
@@ -19,7 +19,9 @@ export fn entry4() void {
     _ = bar;
 }
 
-// function parameter is opaque
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:3:28: error: parameter of opaque type 'FooType' not allowed
 // tmp.zig:8:28: error: parameter of type '@Type(.Null)' not allowed
test/compile_errors/stage1/obj/function_prototype_with_no_body.zig
@@ -3,6 +3,8 @@ export fn entry() void {
     foo();
 }
 
-// function prototype with no body
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:1:1: error: non-extern function has no body
test/compile_errors/stage1/obj/function_returning_opaque_type.zig
@@ -9,7 +9,9 @@ export fn baz() !@TypeOf(undefined) {
     return error.InvalidValue;
 }
 
-// function returning opaque type
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:2:18: error: Opaque return type 'FooType' not allowed
 // tmp.zig:1:1: note: type declared here
test/compile_errors/stage1/obj/function_with_ccc_indirectly_calling_async_function.zig
@@ -8,7 +8,9 @@ fn bar() void {
     suspend {}
 }
 
-// function with ccc indirectly calling async function
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:1:1: error: function with calling convention 'C' cannot be async
 // tmp.zig:2:8: note: async function call here
test/compile_errors/stage1/obj/function_with_invalid_return_type.zig
@@ -1,5 +1,7 @@
 export fn foo() boid {}
 
-// function with invalid return type
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:1:17: error: use of undeclared identifier 'boid'
test/compile_errors/stage1/obj/function_with_non-extern_non-packed_enum_parameter.zig
@@ -1,6 +1,8 @@
 const Foo = enum { A, B, C };
 export fn entry(foo: Foo) void { _ = foo; }
 
-// function with non-extern non-packed enum parameter
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:2:22: error: parameter of type 'Foo' not allowed in function with calling convention 'C'
test/compile_errors/stage1/obj/function_with_non-extern_non-packed_struct_parameter.zig
@@ -5,6 +5,8 @@ const Foo = struct {
 };
 export fn entry(foo: Foo) void { _ = foo; }
 
-// function with non-extern non-packed struct parameter
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:6:22: error: parameter of type 'Foo' not allowed in function with calling convention 'C'
test/compile_errors/stage1/obj/function_with_non-extern_non-packed_union_parameter.zig
@@ -5,6 +5,8 @@ const Foo = union {
 };
 export fn entry(foo: Foo) void { _ = foo; }
 
-// function with non-extern non-packed union parameter
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:6:22: error: parameter of type 'Foo' not allowed in function with calling convention 'C'
test/compile_errors/stage1/obj/generic_fn_as_parameter_without_comptime_keyword.zig
@@ -4,6 +4,8 @@ export fn entry() void {
     f(g);
 }
 
-// generic fn as parameter without comptime keyword
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:1:9: error: parameter of type 'fn(anytype) anytype' must be declared comptime
test/compile_errors/stage1/obj/generic_function_call_assigned_to_incorrect_type.zig
@@ -6,6 +6,8 @@ fn myAlloc(comptime arg: type) anyerror!arg{
     unreachable;
 }
 
-// generic function call assigned to incorrect type
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:3:18: error: expected type '[]i32', found 'anyerror!i32
test/compile_errors/stage1/obj/generic_function_instance_with_non-constant_expression.zig
@@ -5,6 +5,8 @@ fn test1(a: i32, b: i32) i32 {
 
 export fn entry() usize { return @sizeOf(@TypeOf(test1)); }
 
-// generic function instance with non-constant expression
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:3:16: error: runtime value cannot be passed to comptime arg
test/compile_errors/stage1/obj/generic_function_returning_opaque_type.zig
@@ -12,7 +12,9 @@ export fn baz() void {
     _ = generic(@TypeOf(undefined));
 }
 
-// generic function returning opaque type
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:6:16: error: call to generic function with Opaque return type 'FooType' not allowed
 // tmp.zig:2:1: note: function declared here
test/compile_errors/stage1/obj/generic_function_where_return_type_is_self-referenced.zig
@@ -8,6 +8,8 @@ export fn entry() void {
     _ = t;
 }
 
-// generic function where return type is self-referenced
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:1:29: error: evaluation exceeded 1000 backwards branches
test/compile_errors/stage1/obj/global_variable_alignment_non_power_of_2.zig
@@ -1,6 +1,8 @@
 const some_data: [100]u8 align(3) = undefined;
 export fn entry() usize { return @sizeOf(@TypeOf(some_data)); }
 
-// global variable alignment non power of 2
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:1:32: error: alignment value 3 is not a power of 2
test/compile_errors/stage1/obj/global_variable_initializer_must_be_constant_expression.zig
@@ -2,6 +2,8 @@ extern fn foo() i32;
 const x = foo();
 export fn entry() i32 { return x; }
 
-// global variable initializer must be constant expression
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:2:11: error: unable to evaluate constant expression
test/compile_errors/stage1/obj/hasDecl_with_non-container.zig
@@ -2,6 +2,8 @@ export fn entry() void {
     _ = @hasDecl(i32, "hi");
 }
 
-// @hasDecl with non-container
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:2:18: error: expected struct, enum, or union; found 'i32'
test/compile_errors/stage1/obj/if_condition_is_bool_not_int.zig
@@ -2,6 +2,8 @@ export fn f() void {
     if (0) {}
 }
 
-// if condition is bool, not int
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:2:9: error: expected type 'bool', found 'comptime_int'
test/compile_errors/stage1/obj/ignored_assert-err-ok_return_value.zig
@@ -3,6 +3,8 @@ export fn foo() void {
 }
 fn bar() anyerror!i32 { return 0; }
 
-// ignored assert-err-ok return value
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:2:11: error: expression value is ignored
test/compile_errors/stage1/obj/ignored_comptime_statement_value.zig
@@ -2,6 +2,8 @@ export fn foo() void {
     comptime {1;}
 }
 
-// ignored comptime statement value
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:2:15: error: expression value is ignored
test/compile_errors/stage1/obj/ignored_comptime_value.zig
@@ -2,6 +2,8 @@ export fn foo() void {
     comptime 1;
 }
 
-// ignored comptime value
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:2:5: error: expression value is ignored
test/compile_errors/stage1/obj/ignored_deferred_function_call.zig
@@ -3,6 +3,8 @@ export fn foo() void {
 }
 fn bar() anyerror!i32 { return 0; }
 
-// ignored deferred function call
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:2:14: error: error is ignored. consider using `try`, `catch`, or `if`
test/compile_errors/stage1/obj/ignored_deferred_statement_value.zig
@@ -2,6 +2,8 @@ export fn foo() void {
     defer {1;}
 }
 
-// ignored deferred statement value
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:2:12: error: expression value is ignored
test/compile_errors/stage1/obj/ignored_expression_in_while_continuation.zig
@@ -13,7 +13,9 @@ fn bad() anyerror!void {
     return error.Bad;
 }
 
-// ignored expression in while continuation
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:2:24: error: error is ignored. consider using `try`, `catch`, or `if`
 // tmp.zig:6:25: error: error is ignored. consider using `try`, `catch`, or `if`
test/compile_errors/stage1/obj/ignored_return_value.zig
@@ -3,6 +3,8 @@ export fn foo() void {
 }
 fn bar() i32 { return 0; }
 
-// ignored return value
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:2:8: error: expression value is ignored
test/compile_errors/stage1/obj/ignored_statement_value.zig
@@ -2,6 +2,8 @@ export fn foo() void {
     1;
 }
 
-// ignored statement value
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:2:5: error: expression value is ignored
test/compile_errors/stage1/obj/illegal_comparison_of_types.zig
@@ -12,7 +12,9 @@ fn bad_eql_2(a: *const EnumWithData, b: *const EnumWithData) bool {
 export fn entry1() usize { return @sizeOf(@TypeOf(bad_eql_1)); }
 export fn entry2() usize { return @sizeOf(@TypeOf(bad_eql_2)); }
 
-// illegal comparison of types
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:2:14: error: operator not allowed for type '[]u8'
 // tmp.zig:9:16: error: operator not allowed for type 'EnumWithData'
test/compile_errors/stage1/obj/implicit_cast_between_C_pointer_and_Zig_pointer-bad_const-align-child.zig
@@ -29,7 +29,9 @@ export fn f() void {
     _ = x;
 }
 
-// implicit cast between C pointer and Zig pointer - bad const/align/child
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:3:27: error: cast increases pointer alignment
 // tmp.zig:8:18: error: cast discards const qualifier
test/compile_errors/stage1/obj/implicit_cast_const_array_to_mutable_slice.zig
@@ -4,7 +4,9 @@ export fn entry() void {
     _ = sliceA;
 }
 
-// implicit cast const array to mutable slice
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:3:27: error: cannot cast pointer to array literal to slice type '[]u8'
 // tmp.zig:3:27: note: cast discards const qualifier
test/compile_errors/stage1/obj/implicit_cast_from_array_to_mutable_slice.zig
@@ -4,6 +4,8 @@ export fn entry() void {
     foo(global_array);
 }
 
-// implicit cast from array to mutable slice
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:4:9: error: expected type '[]i32', found '[10]i32'
test/compile_errors/stage1/obj/implicit_cast_from_f64_to_f32.zig
@@ -3,6 +3,8 @@ var y: f32 = x;
 
 export fn entry() usize { return @sizeOf(@TypeOf(y)); }
 
-// implicit cast from f64 to f32
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:2:14: error: expected type 'f32', found 'f64'
test/compile_errors/stage1/obj/implicit_cast_of_error_set_not_a_subset.zig
@@ -8,7 +8,9 @@ fn foo(set1: Set1) void {
     _ = x;
 }
 
-// implicit cast of error set not a subset
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:7:19: error: expected type 'Set2', found 'Set1'
 // tmp.zig:1:23: note: 'error.B' not a member of destination error set
test/compile_errors/stage1/obj/implicit_casting_C_pointers_which_would_mess_up_null_semantics.zig
@@ -14,7 +14,9 @@ export fn entry2() void {
     _ = c_ptr;
 }
 
-// implicit casting C pointers which would mess up null semantics
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:6:24: error: expected type '*const [*]const u8', found '[*c]const [*c]const u8'
 // tmp.zig:6:24: note: pointer type child '[*c]const u8' cannot cast into pointer type child '[*]const u8'
test/compile_errors/stage1/obj/implicit_casting_null_c_pointer_to_zig_pointer.zig
@@ -4,6 +4,8 @@ comptime {
     _ = zig_ptr;
 }
 
-// implicit casting null c pointer to zig pointer
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:3:24: error: null pointer casted to type '*u8'
test/compile_errors/stage1/obj/implicit_casting_too_big_integers_to_C_pointers.zig
@@ -8,7 +8,9 @@ export fn b() void {
     _ = ptr;
 }
 
-// implicit casting too big integers to C pointers
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:2:33: error: integer value 18446744073709551617 cannot be coerced to type 'usize'
 // tmp.zig:7:23: error: integer type 'u65' too big for implicit @intToPtr to type '[*c]u8'
test/compile_errors/stage1/obj/implicit_casting_undefined_c_pointer_to_zig_pointer.zig
@@ -4,6 +4,8 @@ comptime {
     _ = zig_ptr;
 }
 
-// implicit casting undefined c pointer to zig pointer
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:3:24: error: use of undefined value here causes undefined behavior
test/compile_errors/stage1/obj/implicit_dependency_on_libc.zig
@@ -0,0 +1,11 @@
+extern "c" fn exit(u8) void;
+export fn entry() void {
+    exit(0);
+}
+
+// error
+// backend=stage1
+// target=native-linux
+// is_test=1
+//
+// tmp.zig:3:5: error: dependency on libc must be explicitly specified in the build command
test/compile_errors/stage1/obj/implicit_semicolon-block_expr.zig
@@ -5,6 +5,8 @@ export fn entry() void {
     var bad = {};
 }
 
-// implicit semicolon - block expr
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:4:11: error: expected ';' after statement
test/compile_errors/stage1/obj/implicit_semicolon-block_statement.zig
@@ -5,6 +5,8 @@ export fn entry() void {
     var bad = {};
 }
 
-// implicit semicolon - block statement
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:4:9: error: expected ';' after statement
test/compile_errors/stage1/obj/implicit_semicolon-comptime_expression.zig
@@ -5,6 +5,8 @@ export fn entry() void {
     var bad = {};
 }
 
-// implicit semicolon - comptime expression
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:4:20: error: expected ';' after statement
test/compile_errors/stage1/obj/implicit_semicolon-comptime_statement.zig
@@ -5,6 +5,8 @@ export fn entry() void {
     var bad = {};
 }
 
-// implicit semicolon - comptime statement
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:4:18: error: expected ';' after statement
test/compile_errors/stage1/obj/implicit_semicolon-defer.zig
@@ -5,6 +5,8 @@ export fn entry() void {
     var bad = {};
 }
 
-// implicit semicolon - defer
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:4:15: error: expected ';' after statement
test/compile_errors/stage1/obj/implicit_semicolon-for_expression.zig
@@ -5,6 +5,8 @@ export fn entry() void {
     var bad = {};
 }
 
-// implicit semicolon - for expression
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:4:26: error: expected ';' after statement
test/compile_errors/stage1/obj/implicit_semicolon-for_statement.zig
@@ -5,6 +5,8 @@ export fn entry() void {
     var bad = {};
 }
 
-// implicit semicolon - for statement
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:4:24: error: expected ';' or 'else' after statement
test/compile_errors/stage1/obj/implicit_semicolon-if-else-if-else_expression.zig
@@ -5,6 +5,8 @@ export fn entry() void {
     var bad = {};
 }
 
-// implicit semicolon - if-else-if-else expression
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:4:45: error: expected ';' after statement
test/compile_errors/stage1/obj/implicit_semicolon-if-else-if-else_statement.zig
@@ -5,6 +5,8 @@ export fn entry() void {
     var bad = {};
 }
 
-// implicit semicolon - if-else-if-else statement
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:4:47: error: expected ';' after statement
test/compile_errors/stage1/obj/implicit_semicolon-if-else-if_expression.zig
@@ -5,6 +5,8 @@ export fn entry() void {
     var bad = {};
 }
 
-// implicit semicolon - if-else-if expression
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:4:37: error: expected ';' after statement
test/compile_errors/stage1/obj/implicit_semicolon-if-else-if_statement.zig
@@ -5,6 +5,8 @@ export fn entry() void {
     var bad = {};
 }
 
-// implicit semicolon - if-else-if statement
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:4:37: error: expected ';' or 'else' after statement
test/compile_errors/stage1/obj/implicit_semicolon-if-else_expression.zig
@@ -5,6 +5,8 @@ export fn entry() void {
     var bad = {};
 }
 
-// implicit semicolon - if-else expression
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:4:28: error: expected ';' after statement
test/compile_errors/stage1/obj/implicit_semicolon-if-else_statement.zig
@@ -5,6 +5,8 @@ export fn entry() void {
     var bad = {};
 }
 
-// implicit semicolon - if-else statement
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:4:28: error: expected ';' after statement
test/compile_errors/stage1/obj/implicit_semicolon-if_expression.zig
@@ -5,6 +5,8 @@ export fn entry() void {
     var bad = {};
 }
 
-// implicit semicolon - if expression
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:4:20: error: expected ';' after statement
test/compile_errors/stage1/obj/implicit_semicolon-if_statement.zig
@@ -5,6 +5,8 @@ export fn entry() void {
     var bad = {};
 }
 
-// implicit semicolon - if statement
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:4:18: error: expected ';' or 'else' after statement
test/compile_errors/stage1/obj/implicit_semicolon-test_expression.zig
@@ -5,6 +5,8 @@ export fn entry() void {
     var bad = {};
 }
 
-// implicit semicolon - test expression
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:4:26: error: expected ';' after statement
test/compile_errors/stage1/obj/implicit_semicolon-test_statement.zig
@@ -5,6 +5,8 @@ export fn entry() void {
     var bad = {};
 }
 
-// implicit semicolon - test statement
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:4:24: error: expected ';' or 'else' after statement
test/compile_errors/stage1/obj/implicit_semicolon-while-continue_expression.zig
@@ -5,6 +5,8 @@ export fn entry() void {
     var bad = {};
 }
 
-// implicit semicolon - while-continue expression
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:4:28: error: expected ';' after statement
test/compile_errors/stage1/obj/implicit_semicolon-while-continue_statement.zig
@@ -5,6 +5,8 @@ export fn entry() void {
     var bad = {};
 }
 
-// implicit semicolon - while-continue statement
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:4:26: error: expected ';' or 'else' after statement
test/compile_errors/stage1/obj/implicit_semicolon-while_expression.zig
@@ -5,6 +5,8 @@ export fn entry() void {
     var bad = {};
 }
 
-// implicit semicolon - while expression
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:4:23: error: expected ';' after statement
test/compile_errors/stage1/obj/implicit_semicolon-while_statement.zig
@@ -5,6 +5,8 @@ export fn entry() void {
     var bad = {};
 }
 
-// implicit semicolon - while statement
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:4:18: error: expected ';' or 'else' after statement
test/compile_errors/stage1/obj/implicitly_casting_enum_to_tag_type.zig
@@ -10,6 +10,8 @@ export fn entry() void {
     _ = x;
 }
 
-// implicitly casting enum to tag type
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:9:22: error: expected type 'u2', found 'Small'
test/compile_errors/stage1/obj/implicitly_increasing_pointer_alignment.zig
@@ -12,6 +12,8 @@ fn bar(x: *u32) void {
     x.* += 1;
 }
 
-// implicitly increasing pointer alignment
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:8:13: error: expected type '*u32', found '*align(1) u32'
test/compile_errors/stage1/obj/implicitly_increasing_slice_alignment.zig
@@ -13,7 +13,9 @@ fn bar(x: []u32) void {
     x[0] += 1;
 }
 
-// implicitly increasing slice alignment
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:9:26: error: cast increases pointer alignment
 // tmp.zig:9:26: note: '*align(1) u32' has alignment 1
test/compile_errors/stage1/obj/import_outside_package_path.zig
@@ -2,6 +2,8 @@ comptime{
     _ = @import("../a.zig");
 }
 
-// import outside package path
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:2:9: error: import of file outside package path: '../a.zig'
test/compile_errors/stage1/obj/incompatible_sentinels.zig
@@ -0,0 +1,29 @@
+// Note: One of the error messages here is backwards. It would be nice to fix, but that's not
+// going to stop me from merging this branch which fixes a bunch of other stuff.
+export fn entry1(ptr: [*:255]u8) [*:0]u8 {
+    return ptr;
+}
+export fn entry2(ptr: [*]u8) [*:0]u8 {
+    return ptr;
+}
+export fn entry3() void {
+    var array: [2:0]u8 = [_:255]u8{ 1, 2 };
+    _ = array;
+}
+export fn entry4() void {
+    var array: [2:0]u8 = [_]u8{ 1, 2 };
+    _ = array;
+}
+
+// error
+// backend=stage1
+// target=native
+//
+// tmp.zig:4:12: error: expected type '[*:0]u8', found '[*:255]u8'
+// tmp.zig:4:12: note: destination pointer requires a terminating '0' sentinel, but source pointer has a terminating '255' sentinel
+// tmp.zig:7:12: error: expected type '[*:0]u8', found '[*]u8'
+// tmp.zig:7:12: note: destination pointer requires a terminating '0' sentinel
+// tmp.zig:10:35: error: expected type '[2:255]u8', found '[2:0]u8'
+// tmp.zig:10:35: note: destination array requires a terminating '255' sentinel, but source array has a terminating '0' sentinel
+// tmp.zig:14:31: error: expected type '[2:0]u8', found '[2]u8'
+// tmp.zig:14:31: note: destination array requires a terminating '0' sentinel
test/compile_errors/stage1/obj/incorrect_return_type.zig
@@ -14,6 +14,8 @@
      unreachable;
  }
 
-// incorrect return type
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:8:16: error: expected type 'A', found 'B'
test/compile_errors/stage1/obj/increase_pointer_alignment_in_ptrCast.zig
@@ -4,7 +4,9 @@ export fn entry() u32 {
     return ptr.*;
 }
 
-// increase pointer alignment in @ptrCast
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:3:17: error: cast increases pointer alignment
 // tmp.zig:3:38: note: '*u8' has alignment 1
test/compile_errors/stage1/obj/indexing_a_undefined_slice_at_comptime.zig
@@ -3,6 +3,8 @@ comptime {
     slice[0] = 2;
 }
 
-// indexing a undefined slice at comptime
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:3:10: error: index 0 outside slice of size 0
test/compile_errors/stage1/obj/indexing_an_array_of_size_zero.zig
@@ -4,6 +4,8 @@ export fn foo() void {
     _ = pointer;
 }
 
-// indexing an array of size zero
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:3:27: error: accessing a zero length array is not allowed
test/compile_errors/stage1/obj/indexing_an_array_of_size_zero_with_runtime_index.zig
@@ -5,6 +5,8 @@ export fn foo() void {
     _ = pointer;
 }
 
-// indexing an array of size zero with runtime index
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:4:27: error: accessing a zero length array is not allowed
test/compile_errors/stage1/obj/indexing_single-item_pointer.zig
@@ -2,6 +2,8 @@ export fn entry(ptr: *i32) i32 {
     return ptr[1];
 }
 
-// indexing single-item pointer
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:2:15: error: index of single-item pointer
test/compile_errors/stage1/obj/indirect_recursion_of_async_functions_detected.zig
@@ -27,7 +27,9 @@ fn rangeSumIndirect(x: i32) i32 {
     return child + 1;
 }
 
-// indirect recursion of async functions detected
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:8:1: error: '@Frame(rangeSum)' depends on itself
 // tmp.zig:15:33: note: when analyzing type '@Frame(rangeSum)' here
test/compile_errors/stage1/obj/indirect_struct_loop.zig
@@ -3,6 +3,8 @@ const B = struct { c : C, };
 const C = struct { a : A, };
 export fn entry() usize { return @sizeOf(A); }
 
-// indirect struct loop
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:1:11: error: struct 'A' depends on itself
test/compile_errors/stage1/obj/inferred_array_size_invalid_here.zig
@@ -8,7 +8,9 @@ export fn entry2() void {
     _ = a;
 }
 
-// inferred array size invalid here
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:2:16: error: unable to infer array size
 // tmp.zig:6:35: error: unable to infer array size
test/compile_errors/stage1/obj/inferring_error_set_of_function_pointer.zig
@@ -2,6 +2,8 @@ comptime {
     const z: ?fn()!void = null;
 }
 
-// inferring error set of function pointer
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:2:19: error: function prototype may not have inferred error set
test/compile_errors/stage1/obj/initializing_array_with_struct_syntax.zig
@@ -3,6 +3,8 @@ export fn entry() void {
     _ = x;
 }
 
-// initializing array with struct syntax
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:2:15: error: initializing array with struct syntax
test/compile_errors/stage1/obj/instantiating_an_undefined_value_for_an_invalid_struct_that_contains_itself.zig
@@ -8,6 +8,8 @@ export fn entry() usize {
     return @sizeOf(@TypeOf(foo.x));
 }
 
-// instantiating an undefined value for an invalid struct that contains itself
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:1:13: error: struct 'Foo' depends on itself
test/compile_errors/stage1/obj/int_to_err_global_invalid_number.zig
@@ -8,6 +8,8 @@ comptime {
     _ = y;
 }
 
-// int to err global invalid number
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:7:13: error: integer value 3 represents no error
test/compile_errors/stage1/obj/int_to_err_non_global_invalid_number.zig
@@ -12,6 +12,8 @@ comptime {
     _ = y;
 }
 
-// int to err non global invalid number
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:11:13: error: error.B not a member of error set 'Set2'
test/compile_errors/stage1/obj/int_to_ptr_of_0_bits.zig
@@ -4,6 +4,8 @@ export fn foo() void {
     _ = y;
 }
 
-// int to ptr of 0 bits
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:3:30: error: type '*void' has 0 bits and cannot store information
test/compile_errors/stage1/obj/integer_cast_truncates_bits.zig
@@ -19,7 +19,9 @@ export fn entry4() void {
     _ = unsigned;
 }
 
-// integer cast truncates bits
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:3:18: error: cast from 'u16' to 'u8' truncates bits
 // tmp.zig:8:22: error: integer value 300 cannot be coerced to type 'u8'
test/compile_errors/stage1/obj/integer_overflow_error.zig
@@ -1,6 +1,8 @@
 const x : u8 = 300;
 export fn entry() usize { return @sizeOf(@TypeOf(x)); }
 
-// integer overflow error
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:1:16: error: integer value 300 cannot be coerced to type 'u8'
test/compile_errors/stage1/obj/integer_underflow_error.zig
@@ -2,6 +2,8 @@ export fn entry() void {
     _ = @intToPtr(*anyopaque, ~@as(usize, @import("std").math.maxInt(usize)) - 1);
 }
 
-// integer underflow error
+// error
+// backend=stage1
+// target=native
 //
 // :2:78: error: operation caused overflow
test/compile_errors/stage1/obj/intToPtr_with_misaligned_address.zig
@@ -3,6 +3,8 @@ pub fn main() void {
     _ = y;
 }
 
-// intToPtr with misaligned address
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:2:13: error: pointer type '[*]align(4) u8' requires aligned address
test/compile_errors/stage1/obj/invalid_break_expression.zig
@@ -2,6 +2,8 @@ export fn f() void {
     break;
 }
 
-// invalid break expression
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:2:5: error: break expression outside loop
test/compile_errors/stage1/obj/invalid_builtin_fn.zig
@@ -2,6 +2,8 @@ fn f() @bogus(foo) {
 }
 export fn entry() void { _ = f(); }
 
-// invalid builtin fn
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:1:8: error: invalid builtin function: '@bogus'
test/compile_errors/stage1/obj/invalid_cast_from_integral_type_to_enum.zig
@@ -10,6 +10,8 @@ fn foo(x: usize) void {
     }
 }
 
-// invalid cast from integral type to enum
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:9:10: error: expected type 'usize', found 'E'
test/compile_errors/stage1/obj/invalid_comparison_for_function_pointers.zig
@@ -3,6 +3,8 @@ const invalid = foo > foo;
 
 export fn entry() usize { return @sizeOf(@TypeOf(invalid)); }
 
-// invalid comparison for function pointers
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:2:21: error: operator not allowed for type 'fn() void'
test/compile_errors/stage1/obj/invalid_continue_expression.zig
@@ -2,6 +2,8 @@ export fn f() void {
     continue;
 }
 
-// invalid continue expression
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:2:5: error: continue expression outside loop
test/compile_errors/stage1/obj/invalid_deref_on_switch_target.zig
@@ -10,6 +10,8 @@ const Tile = enum {
     Filled,
 };
 
-// invalid deref on switch target
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:3:17: error: attempt to dereference non-pointer type 'Tile'
test/compile_errors/stage1/obj/invalid_empty_unicode_escape.zig
@@ -2,6 +2,8 @@ export fn entry() void {
     const a = '\u{}';
 }
 
-// invalid empty unicode escape
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:2:19: error: empty unicode escape sequence
test/compile_errors/stage1/obj/invalid_exponent_in_float_literal-1.zig
@@ -3,7 +3,9 @@ fn main() void {
     _ = bad;
 }
 
-// invalid exponent in float literal - 1
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:2:21: error: expected expression, found 'invalid bytes'
 // tmp.zig:2:28: note: invalid byte: 'a'
test/compile_errors/stage1/obj/invalid_exponent_in_float_literal-2.zig
@@ -3,7 +3,9 @@ fn main() void {
     _ = bad;
 }
 
-// invalid exponent in float literal - 2
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:2:21: error: expected expression, found 'invalid bytes'
 // tmp.zig:2:29: note: invalid byte: 'F'
test/compile_errors/stage1/obj/invalid_field_access_in_comptime.zig
@@ -1,5 +1,7 @@
 comptime { var x = doesnt_exist.whatever; _ = x; }
 
-// invalid field access in comptime
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:1:20: error: use of undeclared identifier 'doesnt_exist'
test/compile_errors/stage1/obj/invalid_field_in_struct_value_expression.zig
@@ -12,6 +12,8 @@ export fn f() void {
     _ = a;
 }
 
-// invalid field in struct value expression
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:10:9: error: no member named 'foo' in struct 'A'
test/compile_errors/stage1/obj/invalid_float_literal.zig
@@ -6,6 +6,8 @@ pub fn main() void {
     std.debug.assert(bad_float < 1.0);
 }
 
-// invalid float literal
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:5:29: error: expected expression, found '.'
test/compile_errors/stage1/obj/invalid_legacy_unicode_escape.zig
@@ -2,7 +2,9 @@ export fn entry() void {
     const a = '\U1234';
 }
 
-// invalid legacy unicode escape
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:2:15: error: expected expression, found 'invalid bytes'
 // tmp.zig:2:18: note: invalid byte: '1'
test/compile_errors/stage1/obj/invalid_maybe_type.zig
@@ -2,6 +2,8 @@ export fn f() void {
     if (true) |x| { _ = x; }
 }
 
-// invalid maybe type
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:2:9: error: expected optional type, found 'bool'
test/compile_errors/stage1/obj/invalid_member_of_builtin_enum.zig
@@ -4,6 +4,8 @@ export fn entry() void {
     _ = foo;
 }
 
-// invalid member of builtin enum
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:3:29: error: container 'std.builtin.Mode' has no member called 'x86'
test/compile_errors/stage1/obj/invalid_multiple_dereferences.zig
@@ -11,7 +11,9 @@ pub const Box = struct {
     field: i32,
 };
 
-// invalid multiple dereferences
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:3:8: error: attempt to dereference non-pointer type 'Box'
 // tmp.zig:8:13: error: attempt to dereference non-pointer type 'Box'
test/compile_errors/stage1/obj/invalid_optional_type_in_extern_struct.zig
@@ -3,6 +3,8 @@ const stroo = extern struct {
 };
 export fn testf(fluff: *stroo) void { _ = fluff; }
 
-// invalid optional type in extern struct
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:2:5: error: extern structs cannot contain fields of type '?[*c]u8'
test/compile_errors/stage1/obj/invalid_pointer_for_var_type.zig
@@ -6,6 +6,8 @@ export fn f() void {
     }
 }
 
-// invalid pointer for var type
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:2:13: error: unable to evaluate constant expression
test/compile_errors/stage1/obj/invalid_pointer_syntax.zig
@@ -2,6 +2,8 @@ export fn foo() void {
     var guid: *:0 const u8 = undefined;
 }
 
-// invalid pointer syntax
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:2:16: error: expected type expression, found ':'
test/compile_errors/stage1/obj/invalid_shift_amount_error.zig
@@ -4,6 +4,8 @@ fn f() u16 {
 }
 export fn entry() u16 { return f(); }
 
-// invalid shift amount error
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:3:17: error: integer value 8 cannot be coerced to type 'u3'
test/compile_errors/stage1/obj/invalid_struct_field.zig
@@ -11,7 +11,9 @@ export fn g() void {
     _ = y;
 }
 
-// invalid struct field
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:4:6: error: no member named 'foo' in struct 'A'
 // tmp.zig:10:16: error: no member named 'bar' in struct 'A'
test/compile_errors/stage1/obj/invalid_suspend_in_exported_function.zig
@@ -7,7 +7,9 @@ fn func() void {
     suspend {}
 }
 
-// invalid suspend in exported function
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:1:1: error: function with calling convention 'C' cannot be async
 // tmp.zig:3:18: note: await here is a suspend point
test/compile_errors/stage1/obj/invalid_type.zig
@@ -1,6 +1,8 @@
 fn a() bogus {}
 export fn entry() void { _ = a(); }
 
-// invalid type
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:1:8: error: use of undeclared identifier 'bogus'
test/compile_errors/stage1/obj/invalid_type_used_in_array_type.zig
@@ -7,6 +7,8 @@ export fn entry() void {
     _ = a;
 }
 
-// invalid type used in array type
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:2:12: error: use of undeclared identifier 'SomeNonexistentType'
test/compile_errors/stage1/obj/invalid_underscore_placement_in_float_literal-1.zig
@@ -3,7 +3,9 @@ fn main() void {
     _ = bad;
 }
 
-// invalid underscore placement in float literal - 1
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:2:21: error: expected expression, found 'invalid bytes'
 // tmp.zig:2:23: note: invalid byte: '_'
test/compile_errors/stage1/obj/invalid_underscore_placement_in_float_literal-10.zig
@@ -3,7 +3,9 @@ fn main() void {
     _ = bad;
 }
 
-// invalid underscore placement in float literal - 10
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:2:21: error: expected expression, found 'invalid bytes'
 // tmp.zig:2:25: note: invalid byte: '_'
test/compile_errors/stage1/obj/invalid_underscore_placement_in_float_literal-11.zig
@@ -3,7 +3,9 @@ fn main() void {
     _ = bad;
 }
 
-// invalid underscore placement in float literal - 11
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:2:21: error: expected expression, found 'invalid bytes'
 // tmp.zig:2:28: note: invalid byte: '_'
test/compile_errors/stage1/obj/invalid_underscore_placement_in_float_literal-12.zig
@@ -3,7 +3,9 @@ fn main() void {
     _ = bad;
 }
 
-// invalid underscore placement in float literal - 12
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:2:21: error: expected expression, found 'invalid bytes'
 // tmp.zig:2:23: note: invalid byte: 'x'
test/compile_errors/stage1/obj/invalid_underscore_placement_in_float_literal-13.zig
@@ -3,7 +3,9 @@ fn main() void {
     _ = bad;
 }
 
-// invalid underscore placement in float literal - 13
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:2:21: error: expected expression, found 'invalid bytes'
 // tmp.zig:2:23: note: invalid byte: '_'
test/compile_errors/stage1/obj/invalid_underscore_placement_in_float_literal-14.zig
@@ -3,7 +3,9 @@ fn main() void {
     _ = bad;
 }
 
-// invalid underscore placement in float literal - 14
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:2:21: error: expected expression, found 'invalid bytes'
 // tmp.zig:2:27: note: invalid byte: 'p'
test/compile_errors/stage1/obj/invalid_underscore_placement_in_float_literal-2.zig
@@ -3,7 +3,9 @@ fn main() void {
     _ = bad;
 }
 
-// invalid underscore placement in float literal - 2
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:2:21: error: expected expression, found 'invalid bytes'
 // tmp.zig:2:23: note: invalid byte: '.'
test/compile_errors/stage1/obj/invalid_underscore_placement_in_float_literal-3.zig
@@ -3,7 +3,9 @@ fn main() void {
     _ = bad;
 }
 
-// invalid underscore placement in float literal - 3
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:2:21: error: expected expression, found 'invalid bytes'
 // tmp.zig:2:25: note: invalid byte: ';'
test/compile_errors/stage1/obj/invalid_underscore_placement_in_float_literal-4.zig
@@ -3,7 +3,9 @@ fn main() void {
     _ = bad;
 }
 
-// invalid underscore placement in float literal - 4
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:2:21: error: expected expression, found 'invalid bytes'
 // tmp.zig:2:25: note: invalid byte: '_'
test/compile_errors/stage1/obj/invalid_underscore_placement_in_float_literal-5.zig
@@ -3,7 +3,9 @@ fn main() void {
     _ = bad;
 }
 
-// invalid underscore placement in float literal - 5
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:2:21: error: expected expression, found 'invalid bytes'
 // tmp.zig:2:26: note: invalid byte: '_'
test/compile_errors/stage1/obj/invalid_underscore_placement_in_float_literal-6.zig
@@ -3,7 +3,9 @@ fn main() void {
     _ = bad;
 }
 
-// invalid underscore placement in float literal - 6
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:2:21: error: expected expression, found 'invalid bytes'
 // tmp.zig:2:26: note: invalid byte: '_'
test/compile_errors/stage1/obj/invalid_underscore_placement_in_float_literal-7.zig
@@ -3,7 +3,9 @@ fn main() void {
     _ = bad;
 }
 
-// invalid underscore placement in float literal - 7
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:2:21: error: expected expression, found 'invalid bytes'
 // tmp.zig:2:28: note: invalid byte: ';'
test/compile_errors/stage1/obj/invalid_underscore_placement_in_float_literal-9.zig
@@ -3,7 +3,9 @@ fn main() void {
     _ = bad;
 }
 
-// invalid underscore placement in float literal - 9
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:2:21: error: expected expression, found 'invalid bytes'
 // tmp.zig:2:23: note: invalid byte: '_'
test/compile_errors/stage1/obj/invalid_underscore_placement_in_int_literal-1.zig
@@ -3,7 +3,9 @@ fn main() void {
     _ = bad;
 }
 
-// invalid underscore placement in int literal - 1
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:2:21: error: expected expression, found 'invalid bytes'
 // tmp.zig:2:26: note: invalid byte: ';'
test/compile_errors/stage1/obj/invalid_underscore_placement_in_int_literal-2.zig
@@ -3,7 +3,9 @@ fn main() void {
     _ = bad;
 }
 
-// invalid underscore placement in int literal - 2
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:2:21: error: expected expression, found 'invalid bytes'
 // tmp.zig:2:28: note: invalid byte: ';'
test/compile_errors/stage1/obj/invalid_underscore_placement_in_int_literal-3.zig
@@ -3,7 +3,9 @@ fn main() void {
     _ = bad;
 }
 
-// invalid underscore placement in int literal - 3
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:2:21: error: expected expression, found 'invalid bytes'
 // tmp.zig:2:28: note: invalid byte: ';'
test/compile_errors/stage1/obj/invalid_underscore_placement_in_int_literal-4.zig
@@ -3,7 +3,9 @@ fn main() void {
     _ = bad;
 }
 
-// invalid underscore placement in int literal - 4
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:2:21: error: expected expression, found 'invalid bytes'
 // tmp.zig:2:28: note: invalid byte: ';'
test/compile_errors/stage1/obj/invalid_union_field_access_in_comptime.zig
@@ -8,6 +8,8 @@ comptime {
     _ = bar_val;
 }
 
-// invalid union field access in comptime
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:7:24: error: accessing union field 'Bar' while field 'Baz' is set
test/compile_errors/stage1/obj/issue_2032_compile_diagnostic_string_for_top_level_decl_type.zig
@@ -3,6 +3,8 @@ export fn entry() void {
     _ = foo;
 }
 
-// compile diagnostic string for top level decl type (issue 2032)
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:2:27: error: type 'u32' does not support array initialization
test/compile_errors/stage1/obj/issue_2687_coerce_from_undefined_array_pointer_to_slice.zig
@@ -18,7 +18,9 @@ export fn foo3() void {
     }
 }
 
-// issue #2687: coerce from undefined array pointer to slice
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:3:19: error: use of undefined value here causes undefined behavior
 // tmp.zig:9:23: error: use of undefined value here causes undefined behavior
test/compile_errors/stage1/obj/issue_3818_bitcast_from_parray-slice_to_u16.zig
@@ -9,7 +9,9 @@ export fn foo2() void {
     _ = word;
 }
 
-// issue #3818: bitcast from parray/slice to u16
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:3:42: error: unable to @bitCast from pointer type '*[2]u8'
 // tmp.zig:8:32: error: destination type 'u16' has size 2 but source type '[]const u8' has size 16
test/compile_errors/stage1/obj/issue_4207_coerce_from_non-terminated-slice_to_terminated-pointer.zig
@@ -3,7 +3,9 @@ export fn foo() [*:0]const u8 {
     return buffer[0..];
 }
 
-// issue #4207: coerce from non-terminated-slice to terminated-pointer
+// error
+// backend=stage1
+// target=native
 //
 // :3:18: error: expected type '[*:0]const u8', found '*[64]u8'
 // :3:18: note: destination pointer requires a terminating '0' sentinel
test/compile_errors/stage1/obj/issue_5221_invalid_struct_init_type_referenced_by_typeInfo_and_passed_into_function.zig
@@ -8,7 +8,9 @@ export fn foo() void {
     comptime ignore(@typeInfo(MyStruct).Struct.fields[0]);
 }
 
-// issue #5221: invalid struct init type referenced by @typeInfo and passed into function
+// error
+// backend=stage1
+// target=native
 //
 // :5:28: error: cannot cast pointer to array literal to slice type '[]u8'
 // :5:28: note: cast discards const qualifier
test/compile_errors/stage1/obj/Issue_5586_Make_unary_minus_for_unsigned_types_a_compile_error.zig
@@ -8,7 +8,9 @@ export fn f2(x: V(4, u32)) V(4, u32) {
     return -y;
 }
 
-// Issue #5586: Make unary minus for unsigned types a compile error
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:3:12: error: negation of type 'u32'
 // tmp.zig:8:12: error: negation of type 'u32'
test/compile_errors/stage1/obj/issue_5618_coercion_of_optional_anyopaque_to_anyopaque_must_fail.zig
@@ -4,6 +4,8 @@ export fn foo() void {
     v = u;
 }
 
-// Issue #5618: coercion of ?*anyopaque to *anyopaque must fail.
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:4:9: error: cannot convert optional to payload type. consider using `.?`, `orelse`, or `if`. expected type '*anyopaque', found '?*anyopaque'
test/compile_errors/stage1/obj/Issue_6823_dont_allow_._to_be_followed_by_.zig
@@ -3,6 +3,8 @@ fn foo() void {
     _ = sequence;
 }
 
-// Issue #6823: don't allow .* to be followed by **
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:2:28: error: '.*' cannot be followed by '*'. Are you missing a space?
test/compile_errors/stage1/obj/issue_7810-comptime_slice-len_increment_beyond_bounds.zig
@@ -7,6 +7,8 @@ export fn foo_slice_len_increment_beyond_bounds() void {
     }
 }
 
-// comptime slice-len increment beyond bounds
+// error
+// backend=stage1
+// target=native
 //
 // :6:12: error: out of bounds slice
test/compile_errors/stage1/obj/Issue_9165_windows_tcp_server_compilation_error.zig
@@ -9,6 +9,8 @@ pub fn main() !void {
     }
 }
 
-// Issue #9165: windows tcp server compilation error
+// error
+// backend=stage1
+// target=native
 //
 // error: Unsupported OS
test/compile_errors/stage1/obj/issue_9346_return_outside_of_function_scope.zig
@@ -1,5 +1,7 @@
 pub const empty = return 1;
 
-// issue #9346: return outside of function scope
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:1:19: error: 'return' outside function scope
test/compile_errors/stage1/obj/labeled_break_not_found.zig
@@ -6,6 +6,8 @@ export fn entry() void {
     }
 }
 
-// labeled break not found
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:4:20: error: label not found: 'outer'
test/compile_errors/stage1/obj/labeled_continue_not_found.zig
@@ -7,6 +7,8 @@ export fn entry() void {
     }
 }
 
-// labeled continue not found
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:5:23: error: label not found: 'outer'
test/compile_errors/stage1/obj/lazy_pointer_with_undefined_element_type.zig
@@ -5,6 +5,8 @@ export fn foo() void {
     _ = I;
 }
 
-// lazy pointer with undefined element type
+// error
+// backend=stage1
+// target=native
 //
 // :3:28: error: use of undefined value here causes undefined behavior
test/compile_errors/stage1/obj/libc_headers_note.zig
@@ -0,0 +1,12 @@
+const c = @cImport(@cInclude("stdio.h"));
+export fn entry() void {
+    _ = c.printf("hello, world!\n");
+}
+
+// error
+// backend=stage1
+// is_test=1
+// target=native-linux
+//
+// tmp.zig:1:11: error: C import failed
+// tmp.zig:1:11: note: libc headers not available; compilation does not link against libc
test/compile_errors/stage1/obj/load_too_many_bytes_from_comptime_reinterpreted_pointer.zig
@@ -6,6 +6,8 @@ export fn entry() void {
     _ = int_val;
 }
 
-// load too many bytes from comptime reinterpreted pointer
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:5:28: error: attempt to read 8 bytes from pointer to f32 which is 4 bytes
test/compile_errors/stage1/obj/load_vector_pointer_with_unknown_runtime_index.zig
@@ -10,6 +10,8 @@ fn loadv(ptr: anytype) i32 {
     return ptr.*;
 }
 
-// load vector pointer with unknown runtime index
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:10:12: error: unable to determine vector element index of type '*align(16:0:4:?) i32
test/compile_errors/stage1/obj/local_shadows_global_that_occurs_later.zig
@@ -4,7 +4,9 @@ pub fn main() void {
 }
 fn foo() void {}
 
-// local shadows global that occurs later
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:2:9: error: local shadows declaration of 'foo'
 // tmp.zig:5:1: note: declared here
test/compile_errors/stage1/obj/local_variable_redeclaration.zig
@@ -3,7 +3,9 @@ export fn f() void {
     var a = 0;
 }
 
-// local variable redeclaration
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:3:9: error: redeclaration of local constant 'a'
 // tmp.zig:2:11: note: previous declaration here
test/compile_errors/stage1/obj/local_variable_redeclares_parameter.zig
@@ -3,7 +3,9 @@ fn f(a : i32) void {
 }
 export fn entry() void { f(1); }
 
-// local variable redeclares parameter
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:2:11: error: redeclaration of function parameter 'a'
 // tmp.zig:1:6: note: previous declaration here
test/compile_errors/stage1/obj/local_variable_shadowing_global.zig
@@ -6,7 +6,9 @@ export fn entry() void {
     _ = Bar;
 }
 
-// local variable shadowing global
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:5:9: error: local shadows declaration of 'Bar'
 // tmp.zig:2:1: note: declared here
test/compile_errors/stage1/obj/locally_shadowing_a_primitive_type.zig
@@ -4,7 +4,9 @@ export fn foo() void {
     _ = a;
 }
 
-// locally shadowing a primitive type
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:2:11: error: name shadows primitive 'u8'
 // tmp.zig:2:11: note: consider using @"u8" to disambiguate
test/compile_errors/stage1/obj/main_function_with_bogus_args_type.zig
@@ -1,5 +1,7 @@
 pub fn main(args: [][]bogus) !void {_ = args;}
 
-// main function with bogus args type
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:1:23: error: use of undeclared identifier 'bogus'
test/compile_errors/stage1/obj/method_call_with_first_arg_type_primitive.zig
@@ -14,6 +14,8 @@ export fn f() void {
     derp.init();
 }
 
-// method call with first arg type primitive
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:14:5: error: expected type 'i32', found 'Foo'
test/compile_errors/stage1/obj/method_call_with_first_arg_type_wrong_container.zig
@@ -23,6 +23,8 @@ export fn foo() void {
     x.init();
 }
 
-// method call with first arg type wrong container
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:23:5: error: expected type '*Allocator', found '*List'
test/compile_errors/stage1/obj/missing_boolean_switch_value.zig
@@ -11,7 +11,9 @@ comptime {
     _ = x;
 }
 
-// missing boolean switch value
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:2:15: error: switch must handle all possibilities
 // tmp.zig:8:15: error: switch must handle all possibilities
test/compile_errors/stage1/obj/missing_const_in_slice_with_nested_array_type.zig
@@ -11,6 +11,8 @@ export fn entry() void {
     _ = geo_data;
 }
 
-// missing const in slice with nested array type
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:4:30: error: array literal requires address-of operator (&) to coerce to slice type '[][2]f32'
test/compile_errors/stage1/obj/missing_else_clause.zig
@@ -8,7 +8,9 @@ fn g(b: bool) void {
 }
 export fn entry() void { f(true); g(true); }
 
-// missing else clause
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:2:21: error: expected type 'i32', found 'void'
 // tmp.zig:6:15: error: incompatible types: 'i32' and 'void'
test/compile_errors/stage1/obj/missing_field_in_struct_value_expression.zig
@@ -13,6 +13,8 @@ export fn f() void {
     _ = a;
 }
 
-// missing field in struct value expression
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:9:17: error: missing field: 'x'
test/compile_errors/stage1/obj/missing_function_call_param.zig
@@ -24,6 +24,8 @@ fn f(foo: *const Foo, index: usize) void {
 
 export fn entry() usize { return @sizeOf(@TypeOf(f)); }
 
-// missing function call param
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:20:34: error: expected 1 argument(s), found 0
test/compile_errors/stage1/obj/missing_function_name.zig
@@ -1,6 +1,8 @@
 fn () void {}
 export fn entry() usize { return @sizeOf(@TypeOf(f)); }
 
-// missing function name
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:1:1: error: missing function name
test/compile_errors/stage1/obj/missing_param_name.zig
@@ -1,6 +1,8 @@
 fn f(i32) void {}
 export fn entry() usize { return @sizeOf(@TypeOf(f)); }
 
-// missing param name
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:1:6: error: missing parameter name
test/compile_errors/stage1/obj/missing_parameter_name_of_generic_function.zig
@@ -4,6 +4,8 @@ export fn entry() void {
     dump(a);
 }
 
-// missing parameter name of generic function
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:1:9: error: missing parameter name
test/compile_errors/stage1/obj/missing_result_type_for_phi_node.zig
@@ -5,6 +5,8 @@ export fn entry() void {
     foo() catch 0;
 }
 
-// missing result type for phi node
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:5:17: error: integer value 0 cannot be coerced to type 'void'
test/compile_errors/stage1/obj/misspelled_type_with_pointer_only_reference.zig
@@ -30,6 +30,8 @@ fn foo() void {
 
 export fn entry() usize { return @sizeOf(@TypeOf(foo)); }
 
-// misspelled type with pointer only reference
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:5:16: error: use of undeclared identifier 'JsonList'
test/compile_errors/stage1/obj/mod_assign_on_undefined_value.zig
@@ -3,6 +3,8 @@ comptime {
     a %= a;
 }
 
-// mod assign on undefined value
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:3:5: error: use of undefined value here causes undefined behavior
test/compile_errors/stage1/obj/mod_on_undefined_value.zig
@@ -3,6 +3,8 @@ comptime {
     _ = a % a;
 }
 
-// mod on undefined value
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:3:9: error: use of undefined value here causes undefined behavior
test/compile_errors/stage1/obj/mul_overflow_in_function_evaluation.zig
@@ -5,6 +5,8 @@ fn mul(a: u16, b: u16) u16 {
 
 export fn entry() usize { return @sizeOf(@TypeOf(y)); }
 
-// mul overflow in function evaluation
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:3:14: error: operation caused overflow
test/compile_errors/stage1/obj/mult_assign_on_undefined_value.zig
@@ -3,6 +3,8 @@ comptime {
     a *= a;
 }
 
-// mult assign on undefined value
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:3:5: error: use of undefined value here causes undefined behavior
test/compile_errors/stage1/obj/mult_on_undefined_value.zig
@@ -3,6 +3,8 @@ comptime {
     _ = a * a;
 }
 
-// mult on undefined value
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:3:9: error: use of undefined value here causes undefined behavior
test/compile_errors/stage1/obj/mult_wrap_assign_on_undefined_value.zig
@@ -3,6 +3,8 @@ comptime {
     a *%= a;
 }
 
-// mult wrap assign on undefined value
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:3:5: error: use of undefined value here causes undefined behavior
test/compile_errors/stage1/obj/mult_wrap_on_undefined_value.zig
@@ -3,6 +3,8 @@ comptime {
     _ = a *% a;
 }
 
-// mult wrap on undefined value
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:3:9: error: use of undefined value here causes undefined behavior
test/compile_errors/stage1/obj/multiple_function_definitions.zig
@@ -2,7 +2,9 @@ fn a() void {}
 fn a() void {}
 export fn entry() void { a(); }
 
-// multiple function definitions
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:2:1: error: redeclaration of 'a'
 // tmp.zig:1:1: note: other declaration here
test/compile_errors/stage1/obj/negate_on_undefined_value.zig
@@ -3,6 +3,8 @@ comptime {
     _ = -a;
 }
 
-// negate on undefined value
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:3:10: error: use of undefined value here causes undefined behavior
test/compile_errors/stage1/obj/negate_wrap_on_undefined_value.zig
@@ -3,6 +3,8 @@ comptime {
     _ = -%a;
 }
 
-// negate wrap on undefined value
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:3:11: error: use of undefined value here causes undefined behavior
test/compile_errors/stage1/obj/negation_overflow_in_function_evaluation.zig
@@ -5,6 +5,8 @@ fn neg(x: i8) i8 {
 
 export fn entry() usize { return @sizeOf(@TypeOf(y)); }
 
-// negation overflow in function evaluation
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:3:12: error: negation caused overflow
test/compile_errors/stage1/obj/nested_error_set_mismatch.zig
@@ -10,7 +10,9 @@ fn foo() ?OtherError!i32 {
     return null;
 }
 
-// nested error set mismatch
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:5:34: error: expected type '?NextError!i32', found '?OtherError!i32'
 // tmp.zig:5:34: note: optional type child 'OtherError!i32' cannot cast into optional type child 'NextError!i32'
test/compile_errors/stage1/obj/no_else_prong_on_switch_on_global_error_set.zig
@@ -7,6 +7,8 @@ fn foo(a: anyerror) void {
     }
 }
 
-// no else prong on switch on global error set
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:5:5: error: else prong required when switching on type 'anyerror'
test/compile_errors/stage1/obj/noalias_on_non_pointer_param.zig
@@ -1,6 +1,8 @@
 fn f(noalias x: i32) void { _ = x; }
 export fn entry() void { f(1234); }
 
-// noalias on non pointer param
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:1:6: error: noalias on non-pointer parameter
test/compile_errors/stage1/obj/non-async_function_pointer_eventually_is_inferred_to_become_async.zig
@@ -6,7 +6,9 @@ fn func() void {
     suspend {}
 }
 
-// non-async function pointer eventually is inferred to become async
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:5:1: error: 'func' cannot be async
 // tmp.zig:3:20: note: required to be non-async here
test/compile_errors/stage1/obj/non-const_expression_function_call_with_struct_return_value_outside_function.zig
@@ -10,6 +10,8 @@ var global_side_effect = false;
 
 export fn entry() usize { return @sizeOf(@TypeOf(a)); }
 
-// non-const expression function call with struct return value outside function
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:6:26: error: unable to evaluate constant expression
test/compile_errors/stage1/obj/non-const_expression_in_struct_literal_outside_function.zig
@@ -6,6 +6,8 @@ extern fn get_it() i32;
 
 export fn entry() usize { return @sizeOf(@TypeOf(a)); }
 
-// non-const expression in struct literal outside function
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:4:21: error: unable to evaluate constant expression
test/compile_errors/stage1/obj/non-const_switch_number_literal.zig
@@ -10,6 +10,8 @@ fn bar() i32 {
     return 2;
 }
 
-// non-const switch number literal
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:5:17: error: cannot store runtime value in type 'comptime_int'
test/compile_errors/stage1/obj/non-const_variables_of_things_that_require_const_variables.zig
@@ -35,7 +35,9 @@ const Foo = struct {
     fn bar(self: *const Foo) void {_ = self;}
 };
 
-// non-const variables of things that require const variables
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:2:4: error: variable of type '*const comptime_int' must be const or comptime
 // tmp.zig:6:4: error: variable of type '@Type(.Undefined)' must be const or comptime
test/compile_errors/stage1/obj/non-enum_tag_type_passed_to_union.zig
@@ -6,6 +6,8 @@ export fn entry() void {
     _ = x;
 }
 
-// non-enum tag type passed to union
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:1:19: error: expected enum tag type, found 'u32'
test/compile_errors/stage1/obj/non-extern_function_with_var_args.zig
@@ -3,6 +3,8 @@ export fn entry() void {
     foo();
 }
 
-// non-extern function with var args
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:1:14: error: expected type expression, found '...'
test/compile_errors/stage1/obj/non-inline_for_loop_on_a_type_that_requires_comptime.zig
@@ -7,6 +7,8 @@ export fn entry() void {
     for (xx) |f| { _ = f;}
 }
 
-// non-inline for loop on a type that requires comptime
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:7:5: error: values of type 'Foo' must be comptime known, but index value is runtime known
test/compile_errors/stage1/obj/non-integer_tag_type_to_automatic_union_enum.zig
@@ -6,6 +6,8 @@ export fn entry() void {
     _ = x;
 }
 
-// non-integer tag type to automatic union enum
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:1:24: error: expected integer tag type, found 'f32'
test/compile_errors/stage1/obj/non-pure_function_returns_type.zig
@@ -17,6 +17,8 @@ export fn function_with_return_type_type() void {
     list.length = 10;
 }
 
-// non-pure function returns type
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:3:7: error: unable to evaluate constant expression
test/compile_errors/stage1/obj/non_async_function_pointer_passed_to_asyncCall.zig
@@ -5,6 +5,8 @@ export fn entry() void {
 }
 fn afunc() void { }
 
-// non async function pointer passed to @asyncCall
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:4:32: error: expected async function, found 'fn() void'
test/compile_errors/stage1/obj/non_compile_time_array_concatenation.zig
@@ -4,6 +4,8 @@ fn f() []u8 {
 var s: [10]u8 = undefined;
 export fn entry() usize { return @sizeOf(@TypeOf(f)); }
 
-// non compile time array concatenation
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:2:12: error: unable to evaluate constant expression
test/compile_errors/stage1/obj/non_constant_expression_in_array_size.zig
@@ -6,7 +6,9 @@ fn get() usize { return global_var; }
 
 export fn entry() usize { return @sizeOf(@TypeOf(Foo)); }
 
-// non constant expression in array size
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:5:25: error: cannot store runtime value in compile time variable
 // tmp.zig:2:12: note: called from here
test/compile_errors/stage1/obj/non_error_sets_used_in_merge_error_sets_operator.zig
@@ -7,7 +7,9 @@ export fn bar() void {
     _ = Errors;
 }
 
-// non error sets used in merge error sets operator
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:2:20: error: expected error set type, found type 'u8'
 // tmp.zig:2:23: note: `||` merges error sets; `or` performs boolean OR
test/compile_errors/stage1/obj/non_float_passed_to_floatToInt.zig
@@ -3,6 +3,8 @@ export fn entry() void {
     _ = x;
 }
 
-// non float passed to @floatToInt
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:2:32: error: expected float type, found 'i32'
test/compile_errors/stage1/obj/non_int_passed_to_intToFloat.zig
@@ -3,6 +3,8 @@ export fn entry() void {
     _ = x;
 }
 
-// non int passed to @intToFloat
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:2:32: error: expected int type, found 'comptime_float'
test/compile_errors/stage1/obj/non_pointer_given_to_ptrToInt.zig
@@ -2,6 +2,8 @@ export fn entry(x: i32) usize {
     return @ptrToInt(x);
 }
 
-// non pointer given to @ptrToInt
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:2:22: error: expected pointer, found 'i32'
test/compile_errors/stage1/obj/normal_string_with_newline.zig
@@ -1,7 +1,9 @@
 const foo = "a
 b";
 
-// normal string with newline
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:1:13: error: expected expression, found 'invalid bytes'
 // tmp.zig:1:15: note: invalid byte: '\n'
test/compile_errors/stage1/obj/offsetOf-bad_field_name.zig
@@ -5,6 +5,8 @@ export fn foo() usize {
     return @offsetOf(Foo, "a",);
 }
 
-// @offsetOf - bad field name
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:5:27: error: struct 'Foo' has no field 'a'
test/compile_errors/stage1/obj/offsetOf-non_struct.zig
@@ -3,6 +3,8 @@ export fn foo() usize {
     return @offsetOf(Foo, "a",);
 }
 
-// @offsetOf - non struct
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:3:22: error: expected struct type, found 'i32'
test/compile_errors/stage1/obj/only_equality_binary_operator_allowed_for_error_sets.zig
@@ -3,6 +3,8 @@ comptime {
     _ = z;
 }
 
-// only equality binary operator allowed for error sets
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:2:23: error: operator not allowed for errors
test/compile_errors/stage1/obj/opaque_type_with_field.zig
@@ -4,6 +4,8 @@ export fn entry() void {
     _ = foo;
 }
 
-// opaque type with field
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:1:25: error: opaque types cannot have fields
test/compile_errors/stage1/obj/optional_pointer_to_void_in_extern_struct.zig
@@ -7,6 +7,8 @@ const Bar = extern struct {
 };
 export fn entry(bar: *Bar) void {_ = bar;}
 
-// optional pointer to void in extern struct
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:2:5: error: extern structs cannot contain fields of type '?*const void'
test/compile_errors/stage1/obj/or_on_undefined_value.zig
@@ -3,6 +3,8 @@ comptime {
     _ = a or a;
 }
 
-// or on undefined value
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:3:9: error: use of undefined value here causes undefined behavior
test/compile_errors/stage1/obj/orelse_on_undefined_value.zig
@@ -3,6 +3,8 @@ comptime {
     _ = a orelse false;
 }
 
-// orelse on undefined value
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:3:11: error: use of undefined value here causes undefined behavior
test/compile_errors/stage1/obj/out_of_range_comptime_int_passed_to_floatToInt.zig
@@ -3,6 +3,8 @@ export fn entry() void {
     _ = x;
 }
 
-// out of range comptime_int passed to @floatToInt
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:2:31: error: integer value 200 cannot be coerced to type 'i8'
test/compile_errors/stage1/obj/overflow_in_enum_value_allocation.zig
@@ -7,6 +7,8 @@ pub fn main() void {
   _ = y;
 }
 
-// overflow in enum value allocation
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:3:5: error: enumeration value 256 too large for type 'u8'
test/compile_errors/stage1/obj/packed_union_given_enum_tag_type.zig
@@ -13,6 +13,8 @@ export fn entry() void {
     _ = a;
 }
 
-// packed union given enum tag type
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:6:30: error: packed union does not support enum tag type
test/compile_errors/stage1/obj/packed_union_with_automatic_layout_field.zig
@@ -11,6 +11,8 @@ export fn entry() void {
     _ = a;
 }
 
-// packed union with automatic layout field
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:6:5: error: non-packed, non-extern struct 'Foo' not allowed in packed union; no guaranteed in-memory representation
test/compile_errors/stage1/obj/panic_called_at_compile_time.zig
@@ -4,6 +4,8 @@ export fn entry() void {
     }
 }
 
-// @panic called at compile time
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:3:9: error: encountered @panic at compile-time
test/compile_errors/stage1/obj/parameter_redeclaration.zig
@@ -2,7 +2,9 @@ fn f(a : i32, a : i32) void {
 }
 export fn entry() void { f(1, 2); }
 
-// parameter redeclaration
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:1:15: error: redeclaration of function parameter 'a'
 // tmp.zig:1:6: note: previous declaration here
test/compile_errors/stage1/obj/parameter_shadowing_global.zig
@@ -4,7 +4,9 @@ export fn entry() void {
     f(1234);
 }
 
-// parameter shadowing global
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:2:6: error: local shadows declaration of 'Foo'
 // tmp.zig:1:1: note: declared here
test/compile_errors/stage1/obj/pass_const_ptr_to_mutable_ptr_fn.zig
@@ -10,6 +10,8 @@ fn ptrEql(a: *[]const u8, b: *[]const u8) bool {
 
 export fn entry() usize { return @sizeOf(@TypeOf(foo)); }
 
-// pass const ptr to mutable ptr fn
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:4:19: error: expected type '*[]const u8', found '*const []const u8'
test/compile_errors/stage1/obj/passing_a_not-aligned-enough_pointer_to_cmpxchg.zig
@@ -5,6 +5,8 @@ export fn entry() bool {
     return x == 5678;
 }
 
-// passing a not-aligned-enough pointer to cmpxchg
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:4:32: error: expected type '*i32', found '*align(1) i32'
test/compile_errors/stage1/obj/passing_an_under-aligned_function_pointer.zig
@@ -6,6 +6,8 @@ fn testImplicitlyDecreaseFnAlign(ptr: fn () align(8) i32, answer: i32) void {
 }
 fn alignedSmall() align(4) i32 { return 1234; }
 
-// passing an under-aligned function pointer
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:2:35: error: expected type 'fn() align(8) i32', found 'fn() align(4) i32'
test/compile_errors/stage1/obj/peer_cast_then_implicit_cast_const_pointer_to_mutable_C_pointer.zig
@@ -3,7 +3,9 @@ export fn func() void {
     strValue = strValue orelse "";
 }
 
-// peer cast then implicit cast const pointer to mutable C pointer
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:3:32: error: expected type '[*c]u8', found '*const [0:0]u8'
 // tmp.zig:3:32: note: cast discards const qualifier
test/compile_errors/stage1/obj/pointer_arithmetic_on_pointer-to-array.zig
@@ -5,6 +5,8 @@ export fn foo() void {
     _ = z;
 }
 
-// pointer arithmetic on pointer-to-array
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:4:17: error: integer value 1 cannot be coerced to type '*[10]u8'
test/compile_errors/stage1/obj/pointer_attributes_checked_when_coercing_pointer_to_anon_literal.zig
@@ -12,7 +12,9 @@ comptime {
     _ = c;
 }
 
-// pointer attributes checked when coercing pointer to anon literal
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:2:31: error: cannot cast pointer to array literal to slice type '[][]const u8'
 // tmp.zig:2:31: note: cast discards const qualifier
test/compile_errors/stage1/obj/pointer_to_noreturn.zig
@@ -1,6 +1,8 @@
 fn a() *noreturn {}
 export fn entry() void { _ = a(); }
 
-// pointer to noreturn
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:1:9: error: pointer to noreturn not allowed
test/compile_errors/stage1/obj/popCount-non-integer.zig
@@ -2,6 +2,8 @@ export fn entry(x: f32) u32 {
     return @popCount(f32, x);
 }
 
-// @popCount - non-integer
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:2:22: error: expected integer type, found 'f32'
test/compile_errors/stage1/obj/prevent_bad_implicit_casting_of_anyframe_types.zig
@@ -15,7 +15,9 @@ export fn c() void {
 }
 fn func() void {}
 
-// prevent bad implicit casting of anyframe types
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:3:28: error: expected type 'anyframe->i32', found 'anyframe'
 // tmp.zig:8:28: error: expected type 'anyframe->i32', found 'i32'
test/compile_errors/stage1/obj/primitives_take_precedence_over_declarations.zig
@@ -4,6 +4,8 @@ export fn entry() void {
     _ = a;
 }
 
-// primitives take precedence over declarations
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:3:19: error: integer value 300 cannot be coerced to type 'u8'
test/compile_errors/stage1/obj/ptrCast_a_0_bit_type_to_a_non-_0_bit_type.zig
@@ -4,7 +4,9 @@ export fn entry() bool {
     return p == null;
 }
 
-// @ptrCast a 0 bit type to a non- 0 bit type
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:3:15: error: '*u0' and '?*u0' do not have the same in-memory representation
 // tmp.zig:3:31: note: '*u0' has no in-memory bits
test/compile_errors/stage1/obj/ptrCast_discards_const_qualifier.zig
@@ -4,6 +4,8 @@ export fn entry() void {
     _ = y;
 }
 
-// @ptrCast discards const qualifier
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:3:15: error: cast discards const qualifier
test/compile_errors/stage1/obj/ptrcast_to_non-pointer.zig
@@ -2,6 +2,8 @@ export fn entry(a: *i32) usize {
     return @ptrCast(usize, a);
 }
 
-// ptrcast to non-pointer
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:2:21: error: expected pointer, found 'usize'
test/compile_errors/stage1/obj/ptrToInt_0_to_non_optional_pointer.zig
@@ -3,6 +3,8 @@ export fn entry() void {
     _ = b;
 }
 
-// @ptrToInt 0 to non optional pointer
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:2:13: error: pointer type '*i32' does not allow address zero
test/compile_errors/stage1/obj/ptrToInt_on_void.zig
@@ -2,6 +2,8 @@ export fn entry() bool {
     return @ptrToInt(&{}) == @ptrToInt(&{});
 }
 
-// @ptrToInt on *void
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:2:23: error: pointer to size 0 type has no address
test/compile_errors/stage1/obj/range_operator_in_switch_used_on_error_set.zig
@@ -12,6 +12,8 @@ fn foo(x: i32) !void {
     }
 }
 
-// range operator in switch used on error set
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:3:17: error: operator not allowed for errors
test/compile_errors/stage1/obj/reading_past_end_of_pointer_casted_array.zig
@@ -6,6 +6,8 @@ comptime {
     _ = deref;
 }
 
-// reading past end of pointer casted array
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:5:26: error: attempt to read 4 bytes from [4]u8 at index 1 which is 3 bytes
test/compile_errors/stage1/obj/recursive_inferred_error_set.zig
@@ -5,6 +5,8 @@ fn foo() !void {
     try foo();
 }
 
-// recursive inferred error set
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:5:5: error: cannot resolve inferred error set '@typeInfo(@typeInfo(@TypeOf(foo)).Fn.return_type.?).ErrorUnion.error_set': function 'foo' not fully analyzed yet
test/compile_errors/stage1/obj/redefinition_of_enums.zig
@@ -1,7 +1,9 @@
 const A = enum {x};
 const A = enum {x};
 
-// redefinition of enums
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:2:1: error: redeclaration of 'A'
 // tmp.zig:1:1: note: other declaration here
test/compile_errors/stage1/obj/redefinition_of_global_variables.zig
@@ -1,7 +1,9 @@
 var a : i32 = 1;
 var a : i32 = 2;
 
-// redefinition of global variables
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:2:1: error: redeclaration of 'a'
 // tmp.zig:1:1: note: other declaration here
test/compile_errors/stage1/obj/redefinition_of_struct.zig
@@ -1,7 +1,9 @@
 const A = struct { x : i32, };
 const A = struct { y : i32, };
 
-// redefinition of struct
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:2:1: error: redeclaration of 'A'
 // tmp.zig:1:1: note: other declaration here
test/compile_errors/stage1/obj/refer_to_the_type_of_a_generic_function.zig
@@ -4,6 +4,8 @@ export fn entry() void {
     f(i32);
 }
 
-// refer to the type of a generic function
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:4:5: error: use of undefined value here causes undefined behavior
test/compile_errors/stage1/obj/referring_to_a_struct_that_is_invalid.zig
@@ -10,6 +10,8 @@ fn assert(ok: bool) void {
     if (!ok) unreachable;
 }
 
-// referring to a struct that is invalid
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:10:14: error: reached unreachable code
test/compile_errors/stage1/obj/regression_test_2980_base_type_u32_is_not_type_checked_properly_when_assigning_a_value_within_a_struct.zig
@@ -14,6 +14,8 @@ export fn entry() void {
     _ = afoo;
 }
 
-// regression test #2980: base type u32 is not type checked properly when assigning a value within a struct
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:12:25: error: cannot convert error union to payload type. consider using `try`, `catch`, or `if`. expected type 'u32', found '@typeInfo(@typeInfo(@TypeOf(get_uval)).Fn.return_type.?).ErrorUnion.error_set!u32'
test/compile_errors/stage1/obj/reify_type.Fn_with_is_generic_true.zig
@@ -10,6 +10,8 @@ const Foo = @Type(.{
 });
 comptime { _ = Foo; }
 
-// @Type(.Fn) with is_generic = true
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:1:20: error: Type.Fn.is_generic must be false for @Type
test/compile_errors/stage1/obj/reify_type.Fn_with_is_var_args_true_and_non-C_callconv.zig
@@ -10,6 +10,8 @@ const Foo = @Type(.{
 });
 comptime { _ = Foo; }
 
-// @Type(.Fn) with is_var_args = true and non-C callconv
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:1:20: error: varargs functions must have C calling convention
test/compile_errors/stage1/obj/reify_type.Fn_with_return_type_null.zig
@@ -10,6 +10,8 @@ const Foo = @Type(.{
 });
 comptime { _ = Foo; }
 
-// @Type(.Fn) with return_type = null
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:1:20: error: Type.Fn.return_type must be non-null for @Type
test/compile_errors/stage1/obj/reify_type.Pointer_with_invalid_address_space.zig
@@ -11,6 +11,8 @@ export fn entry() void {
     }});
 }
 
-// @Type(.Pointer) with invalid address space 
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:2:16: error: address space 'gs' not available in stage 1 compiler, must be .generic
test/compile_errors/stage1/obj/reify_type_for_exhaustive_enum_with_non-integer_tag_type.zig
@@ -11,6 +11,8 @@ export fn entry() void {
     _ = @intToEnum(Tag, 0);
 }
 
-// @Type for exhaustive enum with non-integer tag type
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:1:20: error: Type.Enum.tag_type must be an integer type, not 'bool'
test/compile_errors/stage1/obj/reify_type_for_exhaustive_enum_with_undefined_tag_type.zig
@@ -11,6 +11,8 @@ export fn entry() void {
     _ = @intToEnum(Tag, 0);
 }
 
-// @Type for exhaustive enum with undefined tag type
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:1:20: error: use of undefined value here causes undefined behavior
test/compile_errors/stage1/obj/reify_type_for_exhaustive_enum_with_zero_fields.zig
@@ -11,6 +11,8 @@ export fn entry() void {
     _ = @intToEnum(Tag, 0);
 }
 
-// @Type for exhaustive enum with zero fields
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:1:20: error: enums must have 1 or more fields
test/compile_errors/stage1/obj/reify_type_for_tagged_union_with_extra_enum_field.zig
@@ -27,6 +27,8 @@ export fn entry() void {
     tagged = .{ .unsigned = 1 };
 }
 
-// @Type for tagged union with extra enum field
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:14:23: error: enum field missing: 'arst'
test/compile_errors/stage1/obj/reify_type_for_tagged_union_with_extra_union_field.zig
@@ -27,7 +27,9 @@ export fn entry() void {
     tagged = .{ .unsigned = 1 };
 }
 
-// @Type for tagged union with extra union field
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:13:23: error: enum field not found: 'arst'
 // tmp.zig:1:20: note: enum declared here
test/compile_errors/stage1/obj/reify_type_for_union_with_opaque_field.zig
@@ -12,6 +12,8 @@ export fn entry() void {
     _ = Untagged{};
 }
 
-// @Type for union with opaque field
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:1:25: error: opaque types have unknown size and therefore cannot be directly embedded in unions
test/compile_errors/stage1/obj/reify_type_for_union_with_zero_fields.zig
@@ -10,6 +10,8 @@ export fn entry() void {
     _ = Untagged{};
 }
 
-// @Type for union with zero fields
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:1:25: error: unions must have 1 or more fields
test/compile_errors/stage1/obj/reify_type_union_payload_is_undefined.zig
@@ -3,6 +3,8 @@ const Foo = @Type(.{
 });
 comptime { _ = Foo; }
 
-// @Type() union payload is undefined
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:1:20: error: use of undefined value here causes undefined behavior
test/compile_errors/stage1/obj/reify_type_with_non-constant_expression.zig
@@ -4,6 +4,8 @@ export fn entry() void {
     _ = @Type(globalTypeInfo);
 }
 
-// @Type with non-constant expression
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:4:15: error: unable to evaluate constant expression
test/compile_errors/stage1/obj/reify_type_with_Type.Int.zig
@@ -6,6 +6,8 @@ export fn entry() void {
     });
 }
 
-// @Type with Type.Int
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:3:31: error: expected type 'std.builtin.Type', found 'std.builtin.Type.Int'
test/compile_errors/stage1/obj/reify_type_with_undefined.zig
@@ -12,7 +12,9 @@ comptime {
     });
 }
 
-// @Type with undefined
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:2:16: error: use of undefined value here causes undefined behavior
 // tmp.zig:5:16: error: use of undefined value here causes undefined behavior
test/compile_errors/stage1/obj/result_location_incompatibility_mismatching_handle_is_ptr.zig
@@ -11,6 +11,8 @@ pub const Container = struct {
     not_optional: i32,
 };
 
-// result location incompatibility mismatching handle_is_ptr
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:3:36: error: cannot convert optional to payload type. consider using `.?`, `orelse`, or `if`. expected type 'i32', found '?i32'
test/compile_errors/stage1/obj/result_location_incompatibility_mismatching_handle_is_ptr_generic_call.zig
@@ -11,6 +11,8 @@ pub const Container = struct {
     not_optional: i32,
 };
 
-// result location incompatibility mismatching handle_is_ptr (generic call)
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:3:36: error: cannot convert optional to payload type. consider using `.?`, `orelse`, or `if`. expected type 'i32', found '?i32'
test/compile_errors/stage1/obj/return_from_defer_expression.zig
@@ -14,6 +14,8 @@ pub fn maybeInt() ?i32 {
 
 export fn entry() usize { return @sizeOf(@TypeOf(testTrickyDefer)); }
 
-// return from defer expression
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:4:11: error: 'try' not allowed inside defer expression
test/compile_errors/stage1/obj/returning_error_from_void_async_function.zig
@@ -5,6 +5,8 @@ fn amain() callconv(.Async) void {
     return error.ShouldBeCompileError;
 }
 
-// returning error from void async function
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:5:17: error: expected type 'void', found 'error{ShouldBeCompileError}'
test/compile_errors/stage1/obj/runtime-known_async_function_called.zig
@@ -7,6 +7,8 @@ fn amain() void {
 }
 fn afunc() callconv(.Async) void {}
 
-// runtime-known async function called
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:6:12: error: function is not comptime-known; @asyncCall required
test/compile_errors/stage1/obj/runtime-known_function_called_with_async_keyword.zig
@@ -5,6 +5,8 @@ export fn entry() void {
 
 fn afunc() callconv(.Async) void { }
 
-// runtime-known function called with async keyword
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:3:15: error: function is not comptime-known; @asyncCall required
test/compile_errors/stage1/obj/runtime_assignment_to_comptime_struct_type.zig
@@ -8,6 +8,8 @@ export fn f() void {
     _ = foo;
 }
 
-// runtime assignment to comptime struct type
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:7:23: error: unable to evaluate constant expression
test/compile_errors/stage1/obj/runtime_assignment_to_comptime_union_type.zig
@@ -8,6 +8,8 @@ export fn f() void {
     _ = foo;
 }
 
-// runtime assignment to comptime union type
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:7:23: error: unable to evaluate constant expression
test/compile_errors/stage1/obj/runtime_cast_to_union_which_has_non-void_fields.zig
@@ -12,7 +12,9 @@ fn foo(l: Letter) void {
     _ = x;
 }
 
-// runtime cast to union which has non-void fields
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:11:20: error: runtime cast to union 'Value' which has non-void fields
 // tmp.zig:3:5: note: field 'A' has type 'i32'
test/compile_errors/stage1/obj/runtime_index_into_comptime_type_slice.zig
@@ -10,6 +10,8 @@ export fn entry() void {
     _ = field;
 }
 
-// runtime index into comptime type slice
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:9:51: error: values of type 'std.builtin.Type.StructField' must be comptime known, but index value is runtime known
test/compile_errors/stage1/obj/saturating_arithmetic_does_not_allow_floats.zig
@@ -2,6 +2,8 @@ export fn a() void {
     _ = @as(f32, 1.0) +| @as(f32, 1.0);
 }
 
-// saturating arithmetic does not allow floats
+// error
+// backend=stage1
+// target=native
 //
 // error: invalid operands to binary expression: 'f32' and 'f32'
test/compile_errors/stage1/obj/saturating_shl_assign_does_not_allow_negative_rhs_at_comptime.zig
@@ -5,6 +5,8 @@ export fn a() void {
   }
 }
 
-// saturating shl assign does not allow negative rhs at comptime
+// error
+// backend=stage1
+// target=native
 //
 // error: shift by negative value -2
test/compile_errors/stage1/obj/saturating_shl_does_not_allow_negative_rhs_at_comptime.zig
@@ -2,6 +2,8 @@ export fn a() void {
     _ = @as(i32, 1) <<| @as(i32, -2);
 }
 
-// saturating shl does not allow negative rhs at comptime
+// error
+// backend=stage1
+// target=native
 //
 // error: shift by negative value -2
test/compile_errors/stage1/obj/setAlignStack_in_inline_function.zig
@@ -5,6 +5,8 @@ fn foo() callconv(.Inline) void {
     @setAlignStack(16);
 }
 
-// @setAlignStack in inline function
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:5:5: error: @setAlignStack in inline function
test/compile_errors/stage1/obj/setAlignStack_in_naked_function.zig
@@ -2,6 +2,8 @@ export fn entry() callconv(.Naked) void {
     @setAlignStack(16);
 }
 
-// @setAlignStack in naked function
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:2:5: error: @setAlignStack in naked function
test/compile_errors/stage1/obj/setAlignStack_outside_function.zig
@@ -2,6 +2,8 @@ comptime {
     @setAlignStack(16);
 }
 
-// @setAlignStack outside function
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:2:5: error: @setAlignStack outside function
test/compile_errors/stage1/obj/setAlignStack_set_twice.zig
@@ -3,7 +3,9 @@ export fn entry() void {
     @setAlignStack(16);
 }
 
-// @setAlignStack set twice
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:3:5: error: alignstack set twice
 // tmp.zig:2:5: note: first set here
test/compile_errors/stage1/obj/setAlignStack_too_big.zig
@@ -2,6 +2,8 @@ export fn entry() void {
     @setAlignStack(511 + 1);
 }
 
-// @setAlignStack too big
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:2:5: error: attempt to @setAlignStack(512); maximum is 256
test/compile_errors/stage1/obj/setFloatMode_twice_for_same_scope.zig
@@ -3,7 +3,9 @@ export fn foo() void {
     @setFloatMode(@import("std").builtin.FloatMode.Optimized);
 }
 
-// @setFloatMode twice for same scope
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:3:5: error: float mode set twice for same scope
 // tmp.zig:2:5: note: first set here
test/compile_errors/stage1/obj/setRuntimeSafety_twice_for_same_scope.zig
@@ -3,7 +3,9 @@ export fn foo() void {
     @setRuntimeSafety(false);
 }
 
-// @setRuntimeSafety twice for same scope
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:3:5: error: runtime safety set twice for same scope
 // tmp.zig:2:5: note: first set here
test/compile_errors/stage1/obj/setting_a_section_on_a_local_variable.zig
@@ -3,6 +3,8 @@ export fn entry() i32 {
     return foo;
 }
 
-// setting a section on a local variable
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:2:30: error: cannot set section of local variable 'foo'
test/compile_errors/stage1/obj/shift_amount_has_to_be_an_integer_type.zig
@@ -3,6 +3,8 @@ export fn entry() void {
     _ = x;
 }
 
-// shift amount has to be an integer type
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:2:21: error: shift amount has to be an integer type, but found '*const u8'
test/compile_errors/stage1/obj/shift_by_negative_comptime_integer.zig
@@ -3,6 +3,8 @@ comptime {
     _ = a;
 }
 
-// shift by negative comptime integer
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:2:18: error: shift by negative value -1
test/compile_errors/stage1/obj/shift_left_assign_on_undefined_value.zig
@@ -3,6 +3,8 @@ comptime {
     a >>= 2;
 }
 
-// shift left assign on undefined value
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:3:5: error: use of undefined value here causes undefined behavior
test/compile_errors/stage1/obj/shift_left_on_undefined_value.zig
@@ -3,6 +3,8 @@ comptime {
     _ = a << 2;
 }
 
-// shift left on undefined value
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:3:9: error: use of undefined value here causes undefined behavior
test/compile_errors/stage1/obj/shift_right_assign_on_undefined_value.zig
@@ -3,6 +3,8 @@ comptime {
     a >>= 2;
 }
 
-// shift right assign on undefined value
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:3:5: error: use of undefined value here causes undefined behavior
test/compile_errors/stage1/obj/shift_right_on_undefined_value.zig
@@ -3,6 +3,8 @@ comptime {
     _ = a >> 2;
 }
 
-// shift right on undefined value
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:3:9: error: use of undefined value here causes undefined behavior
test/compile_errors/stage1/obj/shifting_RHS_is_log2_of_LHS_int_bit_width.zig
@@ -2,6 +2,8 @@ export fn entry(x: u8, y: u8) u8 {
     return x << y;
 }
 
-// shifting RHS is log2 of LHS int bit width
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:2:17: error: expected type 'u3', found 'u8'
test/compile_errors/stage1/obj/shifting_without_int_type_or_comptime_known.zig
@@ -2,6 +2,8 @@ export fn entry(x: u8) u8 {
     return 0x11 << x;
 }
 
-// shifting without int type or comptime known
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:2:17: error: LHS of shift must be a fixed-width integer type, or RHS must be compile-time known
test/compile_errors/stage1/obj/shlExact_shifts_out_1_bits.zig
@@ -3,6 +3,8 @@ comptime {
     _ = x;
 }
 
-// @shlExact shifts out 1 bits
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:2:15: error: operation caused overflow
test/compile_errors/stage1/obj/shrExact_shifts_out_1_bits.zig
@@ -3,6 +3,8 @@ comptime {
     _ = x;
 }
 
-// @shrExact shifts out 1 bits
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:2:15: error: exact shift shifted out 1 bits
test/compile_errors/stage1/obj/signed_integer_division.zig
@@ -2,6 +2,8 @@ export fn foo(a: i32, b: i32) i32 {
     return a / b;
 }
 
-// signed integer division
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:2:14: error: division with 'i32' and 'i32': signed integers must use @divTrunc, @divFloor, or @divExact
test/compile_errors/stage1/obj/signed_integer_remainder_division.zig
@@ -2,6 +2,8 @@ export fn foo(a: i32, b: i32) i32 {
     return a % b;
 }
 
-// signed integer remainder division
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:2:14: error: remainder division with 'i32' and 'i32': signed integers and floats must use @rem or @mod
test/compile_errors/stage1/obj/sizeOf_bad_type.zig
@@ -2,6 +2,8 @@ export fn entry() usize {
     return @sizeOf(@TypeOf(null));
 }
 
-// @sizeOf bad type
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:2:20: error: no size available for type '@Type(.Null)'
test/compile_errors/stage1/obj/slice_cannot_have_its_bytes_reinterpreted.zig
@@ -4,6 +4,8 @@ export fn foo() void {
     _ = value;
 }
 
-// slice cannot have its bytes reinterpreted
+// error
+// backend=stage1
+// target=native
 //
 // :3:52: error: slice '[]const u8' cannot have its bytes reinterpreted
test/compile_errors/stage1/obj/slice_passed_as_array_init_type.zig
@@ -3,6 +3,8 @@ export fn entry() void {
     _ = x;
 }
 
-// slice passed as array init type
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:2:15: error: array literal requires address-of operator (&) to coerce to slice type '[]u8'
test/compile_errors/stage1/obj/slice_passed_as_array_init_type_with_elems.zig
@@ -3,6 +3,8 @@ export fn entry() void {
     _ = x;
 }
 
-// slice passed as array init type with elems
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:2:15: error: array literal requires address-of operator (&) to coerce to slice type '[]u8'
test/compile_errors/stage1/obj/slice_sentinel_mismatch-1.zig
@@ -3,6 +3,8 @@ export fn entry() void {
     _ = y;
 }
 
-// slice sentinel mismatch - 1
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:2:37: error: expected type '[:1]const u8', found '*const [2:2]u8'
test/compile_errors/stage1/obj/slice_sentinel_mismatch-2.zig
@@ -4,7 +4,9 @@ fn foo() [:0]u8 {
 }
 comptime { _ = foo; }
 
-// slice sentinel mismatch - 2
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:3:12: error: expected type '[:0]u8', found '[]u8'
 // tmp.zig:3:12: note: destination pointer requires a terminating '0' sentinel
test/compile_errors/stage1/obj/slicing_of_global_undefined_pointer.zig
@@ -3,6 +3,8 @@ export fn entry() void {
     _ = buf[0..1];
 }
 
-// slicing of global undefined pointer
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:3:12: error: non-zero length slice of undefined pointer
test/compile_errors/stage1/obj/slicing_single-item_pointer.zig
@@ -3,6 +3,8 @@ export fn entry(ptr: *i32) void {
     _ = slice;
 }
 
-// slicing single-item pointer
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:2:22: error: slice of single-item pointer
test/compile_errors/stage1/obj/specify_enum_tag_type_that_is_too_small.zig
@@ -11,6 +11,8 @@ export fn entry() void {
     _ = x;
 }
 
-// specify enum tag type that is too small
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:6:5: error: enumeration value 4 too large for type 'u2'
test/compile_errors/stage1/obj/specify_non-integer_enum_tag_type.zig
@@ -9,6 +9,8 @@ export fn entry() void {
     _ = x;
 }
 
-// specify non-integer enum tag type
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:1:21: error: expected integer, found 'f32'
test/compile_errors/stage1/obj/src_outside_function.zig
@@ -2,6 +2,8 @@ comptime {
     @src();
 }
 
-// @src outside function
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:2:5: error: @src outside function
test/compile_errors/stage1/obj/std.fmt_error_for_unused_arguments.zig
@@ -2,6 +2,8 @@ export fn entry() void {
     @import("std").debug.print("{d} {d} {d} {d} {d}", .{1,2,3,4,5,6,7,8,9,10,11,12,13,14,15});
 }
 
-// std.fmt error for unused arguments
+// error
+// backend=stage1
+// target=native
 //
 // ?:?:?: error: 10 unused arguments in '{d} {d} {d} {d} {d}'
test/compile_errors/stage1/obj/store_vector_pointer_with_unknown_runtime_index.zig
@@ -9,6 +9,8 @@ fn storev(ptr: anytype, val: i32) void {
     ptr.* = val;
 }
 
-// store vector pointer with unknown runtime index
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:9:8: error: unable to determine vector element index of type '*align(16:0:4:?) i32
test/compile_errors/stage1/obj/storing_runtime_value_in_compile_time_variable_then_using_it.zig
@@ -42,6 +42,8 @@ export fn entry() void {
     }
 }
 
-// storing runtime value in compile time variable then using it
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:38:29: error: cannot store runtime value in compile time variable
test/compile_errors/stage1/obj/struct_depends_on_itself_via_optional_field.zig
@@ -10,7 +10,9 @@ export fn entry() void {
     _ = obj;
 }
 
-// struct depends on itself via optional field
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:1:17: error: struct 'LhsExpr' depends on itself
 // tmp.zig:5:5: note: while checking this field
test/compile_errors/stage1/obj/struct_field_missing_type.zig
@@ -6,6 +6,8 @@ export fn entry() void {
     _ = a;
 }
 
-// struct field missing type
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:2:5: error: struct field missing type
test/compile_errors/stage1/obj/struct_init_syntax_for_array.zig
@@ -3,6 +3,8 @@ comptime {
     _ = foo;
 }
 
-// struct init syntax for array
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:1:13: error: initializing array with struct syntax
test/compile_errors/stage1/obj/struct_with_declarations_unavailable_for_reify_type.zig
@@ -2,6 +2,8 @@ export fn entry() void {
     _ = @Type(@typeInfo(struct { const foo = 1; }));
 }
 
-// struct with declarations unavailable for @Type
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:2:15: error: Type.Struct.decls must be empty for @Type
test/compile_errors/stage1/obj/struct_with_invalid_field.zig
@@ -23,6 +23,8 @@ export fn entry() void {
     _ = a;
 }
 
-// struct with invalid field
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:14:17: error: use of undeclared identifier 'HeaderValue'
test/compile_errors/stage1/obj/sub_assign_on_undefined_value.zig
@@ -3,6 +3,8 @@ comptime {
     a -= a;
 }
 
-// sub assign on undefined value
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:3:5: error: use of undefined value here causes undefined behavior
test/compile_errors/stage1/obj/sub_on_undefined_value.zig
@@ -3,6 +3,8 @@ comptime {
     _ = a - a;
 }
 
-// sub on undefined value
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:3:9: error: use of undefined value here causes undefined behavior
test/compile_errors/stage1/obj/sub_overflow_in_function_evaluation.zig
@@ -5,6 +5,8 @@ fn sub(a: u16, b: u16) u16 {
 
 export fn entry() usize { return @sizeOf(@TypeOf(y)); }
 
-// sub overflow in function evaluation
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:3:14: error: operation caused overflow
test/compile_errors/stage1/obj/sub_wrap_assign_on_undefined_value.zig
@@ -3,6 +3,8 @@ comptime {
     a -%= a;
 }
 
-// sub wrap assign on undefined value
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:3:5: error: use of undefined value here causes undefined behavior
test/compile_errors/stage1/obj/sub_wrap_on_undefined_value.zig
@@ -3,6 +3,8 @@ comptime {
     _ = a -% a;
 }
 
-// sub wrap on undefined value
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:3:9: error: use of undefined value here causes undefined behavior
test/compile_errors/stage1/obj/suspend_inside_suspend_block.zig
@@ -8,7 +8,9 @@ fn foo() void {
     }
 }
 
-// suspend inside suspend block
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:6:9: error: cannot suspend inside suspend block
 // tmp.zig:5:5: note: other suspend block here
test/compile_errors/stage1/obj/switch_expression-duplicate_enumeration_prong.zig
@@ -16,7 +16,9 @@ fn f(n: Number) i32 {
 
 export fn entry() usize { return @sizeOf(@TypeOf(f)); }
 
-// switch expression - duplicate enumeration prong
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:13:15: error: duplicate switch value
 // tmp.zig:10:15: note: other value here
test/compile_errors/stage1/obj/switch_expression-duplicate_enumeration_prong_when_else_present.zig
@@ -17,7 +17,9 @@ fn f(n: Number) i32 {
 
 export fn entry() usize { return @sizeOf(@TypeOf(f)); }
 
-// switch expression - duplicate enumeration prong when else present
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:13:15: error: duplicate switch value
 // tmp.zig:10:15: note: other value here
test/compile_errors/stage1/obj/switch_expression-duplicate_or_overlapping_integer_value.zig
@@ -8,7 +8,9 @@ fn foo(x: u8) u8 {
 }
 export fn entry() usize { return @sizeOf(@TypeOf(foo)); }
 
-// switch expression - duplicate or overlapping integer value
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:6:9: error: duplicate switch value
 // tmp.zig:5:14: note: previous value here
test/compile_errors/stage1/obj/switch_expression-duplicate_type.zig
@@ -9,7 +9,9 @@ fn foo(comptime T: type, x: T) u8 {
 }
 export fn entry() usize { return @sizeOf(@TypeOf(foo(u32, 0))); }
 
-// switch expression - duplicate type
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:6:9: error: duplicate switch value
 // tmp.zig:4:9: note: previous value here
test/compile_errors/stage1/obj/switch_expression-duplicate_type_struct_alias.zig
@@ -13,7 +13,9 @@ fn foo(comptime T: type, x: T) u8 {
 }
 export fn entry() usize { return @sizeOf(@TypeOf(foo(u32, 0))); }
 
-// switch expression - duplicate type (struct alias)
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:10:9: error: duplicate switch value
 // tmp.zig:8:9: note: previous value here
test/compile_errors/stage1/obj/switch_expression-missing_enumeration_prong.zig
@@ -14,6 +14,8 @@ fn f(n: Number) i32 {
 
 export fn entry() usize { return @sizeOf(@TypeOf(f)); }
 
-// switch expression - missing enumeration prong
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:8:5: error: enumeration value 'Number.Four' not handled in switch
test/compile_errors/stage1/obj/switch_expression-multiple_else_prongs.zig
@@ -9,6 +9,8 @@ export fn entry() void {
     f(1234);
 }
 
-// switch expression - multiple else prongs
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:5:9: error: multiple else prongs in switch expression
test/compile_errors/stage1/obj/switch_expression-non_exhaustive_integer_prongs.zig
@@ -5,6 +5,8 @@ fn foo(x: u8) void {
 }
 export fn entry() usize { return @sizeOf(@TypeOf(foo)); }
 
-// switch expression - non exhaustive integer prongs
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:2:5: error: switch must handle all possibilities
test/compile_errors/stage1/obj/switch_expression-switch_on_pointer_type_with_no_else.zig
@@ -6,6 +6,8 @@ fn foo(x: *u8) void {
 const y: u8 = 100;
 export fn entry() usize { return @sizeOf(@TypeOf(foo)); }
 
-// switch expression - switch on pointer type with no else
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:2:5: error: else prong required when switching on type '*u8'
test/compile_errors/stage1/obj/switch_expression-unreachable_else_prong_bool.zig
@@ -7,6 +7,8 @@ fn foo(x: bool) void {
 }
 export fn entry() usize { return @sizeOf(@TypeOf(foo)); }
 
-// switch expression - unreachable else prong (bool)
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:5:9: error: unreachable else prong, all cases already handled
test/compile_errors/stage1/obj/switch_expression-unreachable_else_prong_enum.zig
@@ -17,6 +17,8 @@ fn foo(x: u8) void {
 
 export fn entry() usize { return @sizeOf(@TypeOf(foo)); }
 
-// switch expression - unreachable else prong (enum)
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:14:9: error: unreachable else prong, all cases already handled
test/compile_errors/stage1/obj/switch_expression-unreachable_else_prong_range_i8.zig
@@ -10,6 +10,8 @@ fn foo(x: i8) void {
 }
 export fn entry() usize { return @sizeOf(@TypeOf(foo)); }
 
-// switch expression - unreachable else prong (range i8)
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:8:9: error: unreachable else prong, all cases already handled
test/compile_errors/stage1/obj/switch_expression-unreachable_else_prong_range_u8.zig
@@ -10,6 +10,8 @@ fn foo(x: u8) void {
 }
 export fn entry() usize { return @sizeOf(@TypeOf(foo)); }
 
-// switch expression - unreachable else prong (range u8)
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:8:9: error: unreachable else prong, all cases already handled
test/compile_errors/stage1/obj/switch_expression-unreachable_else_prong_u1.zig
@@ -7,6 +7,8 @@ fn foo(x: u1) void {
 }
 export fn entry() usize { return @sizeOf(@TypeOf(foo)); }
 
-// switch expression - unreachable else prong (u1)
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:5:9: error: unreachable else prong, all cases already handled
test/compile_errors/stage1/obj/switch_expression-unreachable_else_prong_u2.zig
@@ -9,6 +9,8 @@ fn foo(x: u2) void {
 }
 export fn entry() usize { return @sizeOf(@TypeOf(foo)); }
 
-// switch expression - unreachable else prong (u2)
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:7:9: error: unreachable else prong, all cases already handled
test/compile_errors/stage1/obj/switch_on_enum_with_1_field_with_no_prongs.zig
@@ -5,6 +5,8 @@ export fn entry() void {
     switch (f) {}
 }
 
-// switch on enum with 1 field with no prongs
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:5:5: error: enumeration value 'Foo.M' not handled in switch
test/compile_errors/stage1/obj/switch_on_union_with_no_attached_enum.zig
@@ -14,7 +14,9 @@ fn foo(a: *const Payload) void {
     }
 }
 
-// switch on union with no attached enum
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:11:14: error: switch on union which has no attached enum
 // tmp.zig:1:17: note: consider 'union(enum)' here
test/compile_errors/stage1/obj/switch_with_invalid_expression_parameter.zig
@@ -10,6 +10,8 @@ fn Test(comptime T: type) void {
     _ = x;
 }
 
-// switch with invalid expression parameter
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:7:17: error: switch on type 'type' provides no expression parameter
test/compile_errors/stage1/obj/switch_with_overlapping_case_ranges.zig
@@ -6,6 +6,8 @@ export fn entry() void {
     }
 }
 
-// switch with overlapping case ranges
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:5:9: error: duplicate switch value
test/compile_errors/stage1/obj/tagName_used_on_union_with_no_associated_enum_tag.zig
@@ -8,7 +8,9 @@ export fn entry() void {
     _ = tagName;
 }
 
-// @tagName used on union with no associated enum tag
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:7:19: error: union has no associated enum
 // tmp.zig:1:18: note: declared here
test/compile_errors/stage1/obj/take_slice_of_invalid_dereference.zig
@@ -3,6 +3,8 @@ export fn entry() void {
     _ = x;
 }
 
-// take slice of invalid dereference
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:2:18: error: attempt to dereference non-pointer type 'comptime_int'
test/compile_errors/stage1/obj/taking_bit_offset_of_void_field_in_struct.zig
@@ -6,6 +6,8 @@ export fn foo() void {
     _ = fieldOffset;
 }
 
-// taking bit offset of void field in struct
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:5:45: error: zero-bit field 'val' in struct 'Empty' has no offset
test/compile_errors/stage1/obj/taking_byte_offset_of_void_field_in_struct.zig
@@ -6,6 +6,8 @@ export fn foo() void {
     _ = fieldOffset;
 }
 
-// taking byte offset of void field in struct
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:5:42: error: zero-bit field 'val' in struct 'Empty' has no offset
test/compile_errors/stage1/obj/threadlocal_qualifier_on_const.zig
@@ -3,6 +3,8 @@ export fn entry() i32 {
     return x;
 }
 
-// threadlocal qualifier on const
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:1:1: error: threadlocal variable cannot be constant
test/compile_errors/stage1/obj/top_level_decl_dependency_loop.zig
@@ -5,6 +5,8 @@ export fn entry() void {
     _ = c;
 }
 
-// top level decl dependency loop
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:2:19: error: dependency loop detected
test/compile_errors/stage1/obj/truncate_sign_mismatch.zig
@@ -15,7 +15,9 @@ export fn entry4() u8 {
     return @truncate(u8, x);
 }
 
-// truncate sign mismatch
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:3:26: error: expected signed integer type, found 'u32'
 // tmp.zig:7:26: error: expected unsigned integer type, found 'i32'
test/compile_errors/stage1/obj/truncate_undefined_value.zig
@@ -3,6 +3,8 @@ export fn entry() void {
     _ = z;
 }
 
-// @truncate undefined value
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:2:27: error: use of undefined value here causes undefined behavior
test/compile_errors/stage1/obj/try_in_function_with_non_error_return_type.zig
@@ -3,6 +3,8 @@ export fn f() void {
 }
 fn something() anyerror!void { }
 
-// try in function with non error return type
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:2:5: error: expected type 'void', found 'anyerror'
test/compile_errors/stage1/obj/type_checking_function_pointers.zig
@@ -6,6 +6,8 @@ export fn entry() void {
     a(c);
 }
 
-// type checking function pointers
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:6:7: error: expected type 'fn(*const u8) void', found 'fn(u8) void'
test/compile_errors/stage1/obj/type_variables_must_be_constant.zig
@@ -3,6 +3,8 @@ export fn entry() foo {
     return 1;
 }
 
-// type variables must be constant
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:1:1: error: variable of type 'type' must be constant
test/compile_errors/stage1/obj/undeclared_identifier.zig
@@ -4,6 +4,8 @@ export fn a() void {
     c;
 }
 
-// undeclared identifier
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:3:5: error: use of undeclared identifier 'b'
test/compile_errors/stage1/obj/undeclared_identifier_error_should_mark_fn_as_impure.zig
@@ -5,6 +5,8 @@ fn test_a_thing() void {
     bad_fn_call();
 }
 
-// undeclared identifier error should mark fn as impure
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:5:5: error: use of undeclared identifier 'bad_fn_call'
test/compile_errors/stage1/obj/undeclared_identifier_in_unanalyzed_branch.zig
@@ -4,6 +4,8 @@ export fn a() void {
     }
 }
 
-// undeclared identifier in unanalyzed branch
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:3:9: error: use of undeclared identifier 'lol_this_doesnt_exist'
test/compile_errors/stage1/obj/undefined_as_field_type_is_rejected.zig
@@ -6,6 +6,8 @@ export fn entry1() void {
     _ = foo;
 }
 
-// undefined as field type is rejected
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:2:8: error: use of undefined value here causes undefined behavior
test/compile_errors/stage1/obj/undefined_function_call.zig
@@ -2,6 +2,8 @@ export fn a() void {
     b();
 }
 
-// undefined function call
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:2:5: error: use of undeclared identifier 'b'
test/compile_errors/stage1/obj/underscore_is_not_a_declarable_symbol.zig
@@ -3,6 +3,8 @@ export fn f1() usize {
     return _;
 }
 
-// `_` is not a declarable symbol
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:2:9: error: '_' used as an identifier without @"_" syntax
test/compile_errors/stage1/obj/underscore_should_not_be_usable_inside_for.zig
@@ -6,6 +6,8 @@ export fn returns() void {
     }
 }
 
-// `_` should not be usable inside for
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:4:20: error: '_' used as an identifier without @"_" syntax
test/compile_errors/stage1/obj/underscore_should_not_be_usable_inside_while.zig
@@ -9,6 +9,8 @@ fn optionalReturn() ?u32 {
     return 1;
 }
 
-// `_` should not be usable inside while
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:4:20: error: '_' used as an identifier without @"_" syntax
test/compile_errors/stage1/obj/underscore_should_not_be_usable_inside_while_else.zig
@@ -11,6 +11,8 @@ fn optionalReturnError() !?u32 {
     return error.optionalReturnError;
 }
 
-// `_` should not be usable inside while else
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:6:17: error: '_' used as an identifier without @"_" syntax
test/compile_errors/stage1/obj/union_auto-enum_value_already_taken.zig
@@ -10,7 +10,9 @@ export fn entry() void {
     _ = x;
 }
 
-// union auto-enum value already taken
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:6:9: error: enum tag value 60 already taken
 // tmp.zig:4:9: note: other occurrence here
test/compile_errors/stage1/obj/union_enum_field_does_not_match_enum.zig
@@ -14,7 +14,9 @@ export fn entry() void {
     _ = a;
 }
 
-// union enum field does not match enum
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:10:5: error: enum field not found: 'D'
 // tmp.zig:1:16: note: enum declared here
test/compile_errors/stage1/obj/union_fields_with_value_assignments.zig
@@ -6,7 +6,9 @@ export fn entry() void {
     _ = x;
 }
 
-// union fields with value assignments
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:1:24: error: explicitly valued tagged union missing integer tag type
 // tmp.zig:2:14: note: tag value specified here
test/compile_errors/stage1/obj/union_with_0_fields.zig
@@ -1,5 +1,7 @@
 const Foo = union {};
 
-// union with 0 fields
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:1:13: error: union declarations must have at least one tag
test/compile_errors/stage1/obj/union_with_specified_enum_omits_field.zig
@@ -11,7 +11,9 @@ export fn entry() usize {
     return @sizeOf(Payload);
 }
 
-// union with specified enum omits field
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:6:17: error: enum field missing: 'C'
 // tmp.zig:4:5: note: declared here
test/compile_errors/stage1/obj/union_with_too_small_explicit_signed_tag_type.zig
@@ -8,7 +8,9 @@ export fn entry() void {
     _ = U{ .D = 1 };
 }
 
-// union with too small explicit signed tag type
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:1:22: error: specified integer tag type cannot represent every field
 // tmp.zig:1:22: note: type i2 cannot fit values in range 0...3
test/compile_errors/stage1/obj/union_with_too_small_explicit_unsigned_tag_type.zig
@@ -9,7 +9,9 @@ export fn entry() void {
     _ = U{ .E = 1 };
 }
 
-// union with too small explicit unsigned tag type
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:1:22: error: specified integer tag type cannot represent every field
 // tmp.zig:1:22: note: type u2 cannot fit values in range 0...4
test/compile_errors/stage1/obj/unknown_length_pointer_to_opaque.zig
@@ -1,5 +1,7 @@
 export const T = [*]opaque {};
 
-// unknown length pointer to opaque
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:1:21: error: unknown-length pointer to opaque
test/compile_errors/stage1/obj/unreachable_code-double_break.zig
@@ -4,7 +4,9 @@ export fn a() void {
     };
 }
 
-// unreachable code - double break
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:3:9: error: unreachable code
 // tmp.zig:3:20: note: control flow is diverted here
test/compile_errors/stage1/obj/unreachable_code-nested_returns.zig
@@ -2,7 +2,9 @@ export fn a() i32 {
     return return 1;
 }
 
-// unreachable code - nested returns
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:2:5: error: unreachable code
 // tmp.zig:2:12: note: control flow is diverted here
test/compile_errors/stage1/obj/unreachable_code.zig
@@ -5,7 +5,9 @@ export fn a() void {
 
 fn b() void {}
 
-// unreachable code
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:3:6: error: unreachable code
 // tmp.zig:2:5: note: control flow is diverted here
test/compile_errors/stage1/obj/unreachable_executed_at_comptime.zig
@@ -8,7 +8,9 @@ export fn entry() void {
     _ = foo(-42);
 }
 
-// unreachable executed at comptime
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:4:9: error: reached unreachable code
 // tmp.zig:8:12: note: called from here
test/compile_errors/stage1/obj/unreachable_parameter.zig
@@ -1,6 +1,8 @@
 fn f(a: noreturn) void { _ = a; }
 export fn entry() void { f(); }
 
-// unreachable parameter
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:1:9: error: parameter of type 'noreturn' not allowed
test/compile_errors/stage1/obj/unreachable_variable.zig
@@ -3,6 +3,8 @@ export fn f() void {
     _ = a;
 }
 
-// unreachable variable
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:2:25: error: expected type 'noreturn', found 'void'
test/compile_errors/stage1/obj/unreachable_with_return.zig
@@ -1,6 +1,8 @@
 fn a() noreturn {return;}
 export fn entry() void { a(); }
 
-// unreachable with return
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:1:18: error: expected type 'noreturn', found 'void'
test/compile_errors/stage1/obj/unsupported_modifier_at_start_of_asm_output_constraint.zig
@@ -3,6 +3,8 @@ export fn foo() void {
     asm volatile ("" : [baz]"+r"(bar) : : "");
 }
 
-// unsupported modifier at start of asm output constraint
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:3:5: error: invalid modifier starting output constraint for 'baz': '+', only '=' is supported. Compiler TODO: see https://github.com/ziglang/zig/issues/215
test/compile_errors/stage1/obj/unused_variable_error_on_errdefer.zig
@@ -6,6 +6,8 @@ export fn entry() void {
     foo() catch unreachable;
 }
 
-// unused variable error on errdefer
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:2:15: error: unused variable: 'a'
test/compile_errors/stage1/obj/use_anyopaque_as_return_type_of_fn_ptr.zig
@@ -3,6 +3,8 @@ export fn entry() void {
     _ = a;
 }
 
-// use anyopaque as return type of fn ptr
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:2:20: error: return type cannot be opaque
test/compile_errors/stage1/obj/use_implicit_casts_to_assign_null_to_non-nullable_pointer.zig
@@ -7,6 +7,8 @@ export fn entry() void {
     _ = y;
 }
 
-// use implicit casts to assign null to non-nullable pointer
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:4:23: error: expected type '*?*i32', found '**i32'
test/compile_errors/stage1/obj/use_invalid_number_literal_as_array_index.zig
@@ -4,6 +4,8 @@ export fn entry() void {
     _ = arr;
 }
 
-// use invalid number literal as array index
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:1:1: error: unable to infer variable type
test/compile_errors/stage1/obj/use_of_comptime-known_undefined_function_value.zig
@@ -6,6 +6,8 @@ export fn entry() void {
     command.exec();
 }
 
-// use of comptime-known undefined function value
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:6:12: error: use of undefined value here causes undefined behavior
test/compile_errors/stage1/obj/use_of_undeclared_identifier.zig
@@ -2,6 +2,8 @@ export fn f() void {
     b = 3;
 }
 
-// use of undeclared identifier
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:2:5: error: use of undeclared identifier 'b'
test/compile_errors/stage1/obj/using_an_unknown_len_ptr_type_instead_of_array.zig
@@ -6,6 +6,8 @@ comptime {
     _ = resolutions;
 }
 
-// using an unknown len ptr type instead of array
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:1:21: error: expected array type or [_], found '[*][*]const u8'
test/compile_errors/stage1/obj/using_invalid_types_in_function_call_raises_an_error.zig
@@ -4,6 +4,8 @@ export fn entry() void {
     func(MenuEffect.ThisDoesNotExist);
 }
 
-// using invalid types in function call raises an error
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:1:20: error: enum declarations must have at least one tag
test/compile_errors/stage1/obj/usingnamespace_with_wrong_type.zig
@@ -1,5 +1,7 @@
 usingnamespace void;
 
-// usingnamespace with wrong type
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:1:1: error: expected struct, enum, or union; found 'void'
test/compile_errors/stage1/obj/variable_has_wrong_type.zig
@@ -3,6 +3,8 @@ export fn f() i32 {
     return a;
 }
 
-// variable has wrong type
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:3:12: error: expected type 'i32', found '*const [1:0]u8'
test/compile_errors/stage1/obj/variable_in_inline_assembly_template_cannot_be_found.zig
@@ -0,0 +1,12 @@
+export fn entry() void {
+    var sp = asm volatile ("mov %[foo], sp"
+        : [bar] "=r" (-> usize),
+    );
+    _ = sp;
+}
+
+// error
+// backend=stage1
+// target=x86_64-linux-gnu
+//
+// tmp.zig:2:14: error: could not find 'foo' in the inputs or outputs
test/compile_errors/stage1/obj/variable_initialization_compile_error_then_referenced.zig
@@ -12,6 +12,8 @@ export fn entry() void {
     _ = S;
 }
 
-// variable initialization compile error then referenced
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:2:12: error: use of undeclared identifier 'T'
test/compile_errors/stage1/obj/variable_with_type_noreturn.zig
@@ -2,7 +2,9 @@ export fn entry9() void {
     var z: noreturn = return;
 }
 
-// variable with type 'noreturn'
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:2:5: error: unreachable code
 // tmp.zig:2:23: note: control flow is diverted here
test/compile_errors/stage1/obj/vector_index_out_of_bounds.zig
@@ -3,6 +3,8 @@ export fn entry() void {
     _ = x;
 }
 
-// vector index out of bounds
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:2:62: error: index 3 outside vector of size 3
test/compile_errors/stage1/obj/volatile_on_global_assembly.zig
@@ -2,6 +2,8 @@ comptime {
     asm volatile ("");
 }
 
-// volatile on global assembly
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:2:9: error: volatile is meaningless on global assembly
test/compile_errors/stage1/obj/wasmMemoryGrow_is_a_compile_error_in_non-Wasm_targets.zig
@@ -3,6 +3,8 @@ export fn foo() void {
     return;
 }
 
-// wasmMemoryGrow is a compile error in non-Wasm targets
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:2:9: error: @wasmMemoryGrow is a wasm32 feature only
test/compile_errors/stage1/obj/wasmMemorySize_is_a_compile_error_in_non-Wasm_targets.zig
@@ -3,6 +3,8 @@ export fn foo() void {
     return;
 }
 
-// wasmMemorySize is a compile error in non-Wasm targets
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:2:9: error: @wasmMemorySize is a wasm32 feature only
test/compile_errors/stage1/obj/while_expected_bool_got_error_union.zig
@@ -3,6 +3,8 @@ export fn foo() void {
 }
 fn bar() anyerror!i32 { return 1; }
 
-// while expected bool, got error union
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:2:15: error: expected type 'bool', found 'anyerror!i32'
test/compile_errors/stage1/obj/while_expected_bool_got_optional.zig
@@ -3,6 +3,8 @@ export fn foo() void {
 }
 fn bar() ?i32 { return 1; }
 
-// while expected bool, got optional
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:2:15: error: expected type 'bool', found '?i32'
test/compile_errors/stage1/obj/while_expected_error_union_got_bool.zig
@@ -3,6 +3,8 @@ export fn foo() void {
 }
 fn bar() bool { return true; }
 
-// while expected error union, got bool
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:2:15: error: expected error union type, found 'bool'
test/compile_errors/stage1/obj/while_expected_error_union_got_optional.zig
@@ -3,6 +3,8 @@ export fn foo() void {
 }
 fn bar() ?i32 { return 1; }
 
-// while expected error union, got optional
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:2:15: error: expected error union type, found '?i32'
test/compile_errors/stage1/obj/while_expected_optional_got_bool.zig
@@ -3,6 +3,8 @@ export fn foo() void {
 }
 fn bar() bool { return true; }
 
-// while expected optional, got bool
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:2:15: error: expected optional type, found 'bool'
test/compile_errors/stage1/obj/while_expected_optional_got_error_union.zig
@@ -3,6 +3,8 @@ export fn foo() void {
 }
 fn bar() anyerror!i32 { return 1; }
 
-// while expected optional, got error union
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:2:15: error: expected optional type, found 'anyerror!i32'
test/compile_errors/stage1/obj/while_loop_body_expression_ignored.zig
@@ -13,7 +13,9 @@ export fn f3() void {
     while (x) |_| returns() else |_| unreachable;
 }
 
-// while loop body expression ignored
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:5:25: error: expression value is ignored
 // tmp.zig:9:26: error: expression value is ignored
test/compile_errors/stage1/obj/write_to_const_global_variable.zig
@@ -4,6 +4,8 @@ fn f() void {
 }
 export fn entry() void { f(); }
 
-// write to const global variable
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:3:9: error: cannot assign to constant
test/compile_errors/stage1/obj/wrong_frame_type_used_for_async_call.zig
@@ -9,6 +9,8 @@ fn bar() void {
     suspend {}
 }
 
-// wrong frame type used for async call
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:3:13: error: expected type '*@Frame(bar)', found '*@Frame(foo)'
test/compile_errors/stage1/obj/wrong_function_type.zig
@@ -4,6 +4,8 @@ fn b() i32 {return 1;}
 fn c() i32 {return 2;}
 export fn entry() usize { return @sizeOf(@TypeOf(fns)); }
 
-// wrong function type
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:1:28: error: expected type 'fn() void', found 'fn() i32'
test/compile_errors/stage1/obj/wrong_initializer_for_union_payload_of_type_type.zig
@@ -9,6 +9,8 @@ export fn entry() void {
     v.u.A = U{ .A = i32 };
 }
 
-// wrong initializer for union payload of type 'type'
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:9:8: error: use of undefined value here causes undefined behavior
test/compile_errors/stage1/obj/wrong_number_of_arguments.zig
@@ -3,6 +3,8 @@ export fn a() void {
 }
 fn c(d: i32, e: i32, f: i32) void { _ = d; _ = e; _ = f; }
 
-// wrong number of arguments
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:2:6: error: expected 3 argument(s), found 1
test/compile_errors/stage1/obj/wrong_number_of_arguments_for_method_fn_call.zig
@@ -7,6 +7,8 @@ fn f(foo: *const Foo) void {
 }
 export fn entry() usize { return @sizeOf(@TypeOf(f)); }
 
-// wrong number of arguments for method fn call
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:6:15: error: expected 2 argument(s), found 3
test/compile_errors/stage1/obj/wrong_panic_signature_generic_function.zig
@@ -4,7 +4,9 @@ pub fn panic(comptime msg: []const u8, error_return_trace: ?*builtin.StackTrace)
 }
 const builtin = @import("std").builtin;
 
-// wrong panic signature, generic function
+// error
+// backend=stage1
+// target=native
 //
 // error: expected type 'fn([]const u8, ?*std.builtin.StackTrace) noreturn', found 'fn([]const u8,anytype) anytype'
 // note: only one of the functions is generic
test/compile_errors/stage1/obj/wrong_panic_signature_runtime_function.zig
@@ -3,6 +3,8 @@ test "" {}
 pub fn panic() void {}
 
 
-// wrong panic signature, runtime function
+// error
+// backend=stage1
+// target=native
 //
 // error: expected type 'fn([]const u8, ?*std.builtin.StackTrace) noreturn', found 'fn() void'
test/compile_errors/stage1/obj/wrong_pointer_coerced_to_pointer_to_opaque_{}.zig
@@ -5,6 +5,8 @@ export fn foo() void {
     bar(@ptrCast(*anyopaque, &x));
 }
 
-// wrong pointer coerced to pointer to opaque {}
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:5:9: error: expected type '*Derp', found '*anyopaque'
test/compile_errors/stage1/obj/wrong_return_type_for_main.zig
@@ -1,5 +1,7 @@
 pub fn main() f32 { }
 
-// wrong return type for main
+// error
+// backend=stage1
+// target=native
 //
 // error: expected return type of main to be 'void', '!void', 'noreturn', 'u8', or '!u8'
test/compile_errors/stage1/obj/wrong_size_to_an_array_literal.zig
@@ -3,6 +3,8 @@ comptime {
     _ = array;
 }
 
-// wrong size to an array literal
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:2:31: error: index 2 outside array of size 2
test/compile_errors/stage1/obj/wrong_type_for_argument_tuple_to_asyncCall.zig
@@ -7,6 +7,8 @@ fn foo() i32 {
     return 0;
 }
 
-// wrong type for argument tuple to @asyncCall
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:3:33: error: expected tuple or struct, found 'void'
test/compile_errors/stage1/obj/wrong_type_for_reify_type.zig
@@ -2,6 +2,8 @@ export fn entry() void {
     _ = @Type(0);
 }
 
-// wrong type for @Type
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:2:15: error: expected type 'std.builtin.Type', found 'comptime_int'
test/compile_errors/stage1/obj/wrong_type_for_result_ptr_to_asyncCall.zig
@@ -9,6 +9,8 @@ fn foo() i32 {
     return 1234;
 }
 
-// wrong type for result ptr to @asyncCall
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:6:37: error: expected type '*i32', found 'bool'
test/compile_errors/stage1/obj/wrong_type_passed_to_panic.zig
@@ -3,6 +3,8 @@ export fn entry() void {
     @panic(e);
 }
 
-// wrong type passed to @panic
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:3:12: error: expected type '[]const u8', found 'error{Foo}'
test/compile_errors/stage1/obj/wrong_type_to_hasField.zig
@@ -2,6 +2,8 @@ export fn entry() bool {
     return @hasField(i32, "hi");
 }
 
-// wrong type to @hasField
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:2:22: error: type 'i32' does not support @hasField
test/compile_errors/stage1/obj/wrong_types_given_to_atomic_order_args_in_cmpxchg.zig
@@ -3,6 +3,8 @@ export fn entry() void {
     while (!@cmpxchgWeak(i32, &x, 1234, 5678, @as(u32, 1234), @as(u32, 1234))) {}
 }
 
-// wrong types given to atomic order args in cmpxchg
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:3:47: error: expected type 'std.builtin.AtomicOrder', found 'u32'
test/compile_errors/stage1/obj/wrong_types_given_to_export.zig
@@ -3,6 +3,8 @@ comptime {
     @export(entry, .{.name = "entry", .linkage = @as(u32, 1234) });
 }
 
-// wrong types given to @export
+// error
+// backend=stage1
+// target=native
 //
 // tmp.zig:3:59: error: expected type 'std.builtin.GlobalLinkage', found 'comptime_int'
test/compile_errors/stage1/test/access_invalid_typeInfo_decl.zig
@@ -3,6 +3,9 @@ test "Crash" {
     _ = @typeInfo(@This()).Struct.decls[0];
 }
 
-// access invalid @typeInfo decl
+// error
+// backend=stage1
+// target=native
+// is_test=1
 //
 // tmp.zig:1:11: error: use of undeclared identifier 'B'
test/compile_errors/stage1/test/alignCast_of_zero_sized_types.zig
@@ -17,7 +17,10 @@ export fn qux() void {
     _ = @alignCast(2, a);
 }
 
-// @alignCast of zero sized types
+// error
+// backend=stage1
+// target=native
+// is_test=1
 //
 // tmp.zig:3:23: error: cannot adjust alignment of zero sized type '*void'
 // tmp.zig:7:23: error: cannot adjust alignment of zero sized type '?*void'
test/compile_errors/stage1/test/bad_splat_type.zig
@@ -4,6 +4,9 @@ export fn entry() void {
     _ = v;
 }
 
-// bad @splat type
+// error
+// backend=stage1
+// target=native
+// is_test=1
 //
 // tmp.zig:3:23: error: vector element type must be integer, float, bool, or pointer; 'comptime_int' is invalid
test/compile_errors/stage1/test/binary_OR_operator_on_error_sets.zig
@@ -5,6 +5,9 @@ export fn entry() void {
     _ = x;
 }
 
-// binary OR operator on error sets
+// error
+// backend=stage1
+// target=native
+// is_test=1
 //
 // tmp.zig:2:18: error: invalid operands to binary expression: 'error{A}' and 'error{B}'
test/compile_errors/stage1/test/call_rejects_non_comptime-known_fn-always_inline.zig
@@ -3,6 +3,9 @@ pub export fn entry() void {
     @call(.{ .modifier = .always_inline }, call_me, .{});
 }
 
-// @call rejects non comptime-known fn - always_inline
+// error
+// backend=stage1
+// target=native
+// is_test=1
 //
 // tmp.zig:3:5: error: the specified modifier requires a comptime-known function
test/compile_errors/stage1/test/call_rejects_non_comptime-known_fn-compile_time.zig
@@ -3,6 +3,9 @@ pub export fn entry() void {
     @call(.{ .modifier = .compile_time }, call_me, .{});
 }
 
-// @call rejects non comptime-known fn - compile_time
+// error
+// backend=stage1
+// target=native
+// is_test=1
 //
 // tmp.zig:3:5: error: the specified modifier requires a comptime-known function
test/compile_errors/stage1/test/cast_between_optional_T_where_T_is_not_a_pointer.zig
@@ -6,7 +6,10 @@ export fn entry() void {
     a = b;
 }
 
-// cast between ?T where T is not a pointer
+// error
+// backend=stage1
+// target=native
+// is_test=1
 //
 // tmp.zig:6:9: error: expected type '?fn(i8) void', found '?fn(u64) void'
 // tmp.zig:6:9: note: optional type child 'fn(u64) void' cannot cast into optional type child 'fn(i8) void'
test/compile_errors/stage1/test/combination_of_nosuspend_and_async.zig
@@ -7,7 +7,10 @@ export fn entry() void {
 }
 fn foo() void {}
 
-// combination of nosuspend and async
+// error
+// backend=stage1
+// target=native
+// is_test=1
 //
 // tmp.zig:4:9: error: suspend inside nosuspend block
 // tmp.zig:2:5: note: nosuspend block here
test/compile_errors/stage1/test/comparison_of_non-tagged_union_and_enum_literal.zig
@@ -5,7 +5,10 @@ export fn entry() void {
     _ = ok;
 }
 
-// comparison of non-tagged union and enum literal
+// error
+// backend=stage1
+// target=native
+// is_test=1
 //
 // tmp.zig:4:16: error: comparison of union and enum literal is only valid for tagged union types
 // tmp.zig:2:15: note: type U is not a tagged union
test/compile_errors/stage1/test/comptime_vector_overflow_shows_the_index.zig
@@ -5,7 +5,10 @@ comptime {
     _ = x;
 }
 
-// comptime vector overflow shows the index
+// error
+// backend=stage1
+// target=native
+// is_test=1
 //
 // tmp.zig:4:15: error: operation caused overflow
 // tmp.zig:4:15: note: when computing vector element at index 2
test/compile_errors/stage1/test/duplicate_field_in_anonymous_struct_literal.zig
@@ -10,7 +10,10 @@ export fn entry() void {
     _ = anon;
 }
 
-// duplicate field in anonymous struct literal
+// error
+// backend=stage1
+// target=native
+// is_test=1
 //
 // tmp.zig:7:13: error: duplicate field
 // tmp.zig:4:13: note: other field here
test/compile_errors/stage1/test/error_in_struct_initializer_doesnt_crash_the_compiler.zig
@@ -7,6 +7,9 @@ pub export fn entry() void {
     _ = a;
 }
 
-// error in struct initializer doesn't crash the compiler
+// error
+// backend=stage1
+// target=native
+// is_test=1
 //
 // tmp.zig:4:9: error: duplicate struct field: 'e'
test/compile_errors/stage1/test/errors_in_for_loop_bodies_are_propagated.zig
@@ -3,6 +3,9 @@ pub export fn entry() void {
     for (arr) |bits| _ = @popCount(bits);
 }
 
-// errors in for loop bodies are propagated
+// error
+// backend=stage1
+// target=native
+// is_test=1
 //
 // tmp.zig:3:26: error: expected 2 arguments, found 1
test/compile_errors/stage1/test/export_with_empty_name_string.zig
@@ -3,6 +3,9 @@ comptime {
     @export(entry, .{ .name = "" });
 }
 
-// @export with empty name string
+// error
+// backend=stage1
+// target=native
+// is_test=1
 //
 // tmp.zig:3:5: error: exported symbol name cannot be empty
test/compile_errors/stage1/test/helpful_return_type_error_message.zig
@@ -15,7 +15,10 @@ export fn quux() u32 {
     buf = bar();
 }
 
-// helpful return type error message
+// error
+// backend=stage1
+// target=native
+// is_test=1
 //
 // tmp.zig:2:17: error: expected type 'u32', found 'error{Ohno}'
 // tmp.zig:1:17: note: function cannot return an error
test/compile_errors/stage1/test/int-float_conversion_to_comptime_int-float.zig
@@ -7,7 +7,10 @@ export fn bar() void {
     _ = @intToFloat(comptime_float, a);
 }
 
-// int/float conversion to comptime_int/float
+// error
+// backend=stage1
+// target=native
+// is_test=1
 //
 // tmp.zig:3:35: error: unable to evaluate constant expression
 // tmp.zig:7:37: error: unable to evaluate constant expression
test/compile_errors/stage1/test/invalid_assignments.zig
@@ -10,7 +10,10 @@ export fn entry4() void {
     2 + 2 = 3;
 }
 
-// invalid assignments
+// error
+// backend=stage1
+// target=native
+// is_test=1
 //
 // tmp.zig:3:6: error: invalid left-hand side to assignment
 // tmp.zig:7:7: error: invalid left-hand side to assignment
test/compile_errors/stage1/test/invalid_float_casts.zig
@@ -15,7 +15,10 @@ export fn qux() void {
     _ = @floatCast(f32, a);
 }
 
-// invalid float casts
+// error
+// backend=stage1
+// target=native
+// is_test=1
 //
 // tmp.zig:3:36: error: unable to evaluate constant expression
 // tmp.zig:7:21: error: expected integer type, found 'f32'
test/compile_errors/stage1/test/invalid_int_casts.zig
@@ -15,7 +15,10 @@ export fn qux() void {
     _ = @intCast(u32, a);
 }
 
-// invalid int casts
+// error
+// backend=stage1
+// target=native
+// is_test=1
 //
 // tmp.zig:3:32: error: unable to evaluate constant expression
 // tmp.zig:7:21: error: expected float type, found 'u32'
test/compile_errors/stage1/test/invalid_non-exhaustive_enum_to_union.zig
@@ -18,7 +18,10 @@ export fn bar() void {
     _ = u;
 }
 
-// invalid non-exhaustive enum to union
+// error
+// backend=stage1
+// target=native
+// is_test=1
 //
 // tmp.zig:12:16: error: runtime cast to union 'U' from non-exhaustive enum
 // tmp.zig:17:16: error: no tag by value 15
test/compile_errors/stage1/test/invalid_pointer_with_reify_type.zig
@@ -11,6 +11,9 @@ export fn entry() void {
     }});
 }
 
-// invalid pointer with @Type
+// error
+// backend=stage1
+// target=native
+// is_test=1
 //
 // tmp.zig:2:16: error: sentinels are only allowed on slices and unknown-length pointers
test/compile_errors/stage1/test/nested_vectors.zig
@@ -5,6 +5,9 @@ export fn entry() void {
     _ = v;
 }
 
-// nested vectors
+// error
+// backend=stage1
+// target=native
+// is_test=1
 //
 // tmp.zig:3:23: error: vector element type must be integer, float, bool, or pointer; '@Vector(4, u8)' is invalid
test/compile_errors/stage1/test/non-exhaustive_enum_marker_assigned_a_value.zig
@@ -10,7 +10,10 @@ const B = enum {
 };
 comptime { _ = A; _ = B; }
 
-// non-exhaustive enum marker assigned a value
+// error
+// backend=stage1
+// target=native
+// is_test=1
 //
 // tmp.zig:4:9: error: '_' is used to mark an enum as non-exhaustive and cannot be assigned a value
 // tmp.zig:6:11: error: non-exhaustive enum missing integer tag type
test/compile_errors/stage1/test/non-exhaustive_enums.zig
@@ -13,7 +13,10 @@ pub export fn entry() void {
     _ = C;
 }
 
-// non-exhaustive enums
+// error
+// backend=stage1
+// target=native
+// is_test=1
 //
 // tmp.zig:3:5: error: '_' field of non-exhaustive enum must be last
 // tmp.zig:6:11: error: non-exhaustive enum specifies every value
test/compile_errors/stage1/test/not_an_enum_type.zig
@@ -12,6 +12,9 @@ const Error = union(enum) {
 const InvalidToken = struct {};
 const ExpectedVarDeclOrFn = struct {};
 
-// not an enum type
+// error
+// backend=stage1
+// target=native
+// is_test=1
 //
 // tmp.zig:4:9: error: expected type '@typeInfo(Error).Union.tag_type.?', found 'type'
test/compile_errors/stage1/test/packed_struct_with_fields_of_not_allowed_types.zig
@@ -59,7 +59,10 @@ const Enum = enum {
     B,
 };
 
-// packed struct with fields of not allowed types
+// error
+// backend=stage1
+// target=native
+// is_test=1
 //
 // tmp.zig:2:5: error: type 'anyerror' not allowed in packed struct; no guaranteed in-memory representation
 // tmp.zig:5:5: error: array of 'u24' not allowed in packed struct due to padding bits (must be padded from 48 to 64 bits)
test/compile_errors/stage1/test/ptrToInt_with_pointer_to_zero-sized_type.zig
@@ -4,6 +4,9 @@ export fn entry() void {
     _ = x;
 }
 
-// @ptrToInt with pointer to zero-sized type
+// error
+// backend=stage1
+// target=native
+// is_test=1
 //
 // tmp.zig:3:23: error: pointer to size 0 type has no address
test/compile_errors/stage1/test/reassign_to_array_parameter.zig
@@ -5,6 +5,9 @@ export fn entry() void {
     reassign(.{1, 2, 3});
 }
 
-// reassign to array parameter
+// error
+// backend=stage1
+// target=native
+// is_test=1
 //
 // tmp.zig:2:15: error: cannot assign to constant
test/compile_errors/stage1/test/reassign_to_slice_parameter.zig
@@ -5,6 +5,9 @@ export fn entry() void {
     reassign("foo");
 }
 
-// reassign to slice parameter
+// error
+// backend=stage1
+// target=native
+// is_test=1
 //
 // tmp.zig:2:10: error: cannot assign to constant
test/compile_errors/stage1/test/reassign_to_struct_parameter.zig
@@ -8,6 +8,9 @@ export fn entry() void {
     reassign(S{.x = 3});
 }
 
-// reassign to struct parameter
+// error
+// backend=stage1
+// target=native
+// is_test=1
 //
 // tmp.zig:5:10: error: cannot assign to constant
test/compile_errors/stage1/test/reference_to_const_data.zig
@@ -19,7 +19,10 @@ export fn qux() void {
     ptr.x = 2;
 }
 
-// reference to const data
+// error
+// backend=stage1
+// target=native
+// is_test=1
 //
 // tmp.zig:3:14: error: cannot assign to constant
 // tmp.zig:7:13: error: cannot assign to constant
test/compile_errors/stage1/test/reify_typeOf_with_incompatible_arguments.zig
@@ -4,6 +4,9 @@ export fn entry() void {
     _ = @TypeOf(var_1, var_2);
 }
 
-// @TypeOf with incompatible arguments
+// error
+// backend=stage1
+// target=native
+// is_test=1
 //
 // tmp.zig:4:9: error: incompatible types: 'f32' and 'u32'
test/compile_errors/stage1/test/reify_typeOf_with_no_arguments.zig
@@ -2,6 +2,9 @@ export fn entry() void {
     _ = @TypeOf();
 }
 
-// @TypeOf with no arguments
+// error
+// backend=stage1
+// target=native
+// is_test=1
 //
 // tmp.zig:2:9: error: expected at least 1 argument, found 0
test/compile_errors/stage1/test/reject_extern_function_definitions_with_body.zig
@@ -2,6 +2,9 @@ extern "c" fn definitelyNotInLibC(a: i32, b: i32) i32 {
     return a + b;
 }
 
-// reject extern function definitions with body
+// error
+// backend=stage1
+// target=native
+// is_test=1
 //
 // tmp.zig:1:1: error: extern functions have no body
test/compile_errors/stage1/test/reject_extern_variables_with_initializers.zig
@@ -1,5 +1,8 @@
 extern var foo: int = 2;
 
-// reject extern variables with initializers
+// error
+// backend=stage1
+// target=native
+// is_test=1
 //
 // tmp.zig:1:23: error: extern variables have no initializers
test/compile_errors/stage1/test/repeated_invalid_field_access_to_generic_function_returning_type_crashes_compiler_2655.zig
@@ -6,6 +6,9 @@ test "1" {
     _ = A().a;
 }
 
-// repeated invalid field access to generic function returning type crashes compiler. #2655
+// error
+// backend=stage1
+// target=native
+// is_test=1
 //
 // tmp.zig:2:12: error: use of undeclared identifier 'Q'
test/compile_errors/stage1/test/return_invalid_type_from_test.zig
@@ -1,5 +1,8 @@
 test "example" { return 1; }
 
-// return invalid type from test
+// error
+// backend=stage1
+// target=native
+// is_test=1
 //
 // tmp.zig:1:25: error: expected type 'void', found 'comptime_int'
test/compile_errors/stage1/test/shift_on_type_with_non-power-of-two_size.zig
@@ -23,7 +23,10 @@ export fn entry() void {
     S.d();
 }
 
-// shift on type with non-power-of-two size
+// error
+// backend=stage1
+// target=native
+// is_test=1
 //
 // tmp.zig:5:19: error: RHS of shift is too large for LHS type
 // tmp.zig:9:19: error: RHS of shift is too large for LHS type
test/compile_errors/stage1/test/shuffle_with_selected_index_past_first_vector_length.zig
@@ -5,7 +5,10 @@ export fn entry() void {
     _ = z;
 }
 
-// @shuffle with selected index past first vector length
+// error
+// backend=stage1
+// target=native
+// is_test=1
 //
 // tmp.zig:4:39: error: mask index '4' has out-of-bounds selection
 // tmp.zig:4:27: note: selected index '7' out of bounds of @Vector(4, u32)
test/compile_errors/stage1/test/switch_ranges_endpoints_are_validated.zig
@@ -7,7 +7,10 @@ pub export fn entry() void {
     }
 }
 
-// switch ranges endpoints are validated
+// error
+// backend=stage1
+// target=native
+// is_test=1
 //
 // tmp.zig:4:9: error: range start value is greater than the end value
 // tmp.zig:5:9: error: range start value is greater than the end value
test/compile_errors/stage1/test/switching_with_exhaustive_enum_has___prong_.zig
@@ -11,6 +11,9 @@ pub export fn entry() void {
     }
 }
 
-// switching with exhaustive enum has '_' prong 
+// error
+// backend=stage1
+// target=native
+// is_test=1
 //
 // tmp.zig:7:5: error: switch on exhaustive enum has `_` prong
test/compile_errors/stage1/test/switching_with_non-exhaustive_enums.zig
@@ -25,7 +25,10 @@ pub export fn entry() void {
     }
 }
 
-// switching with non-exhaustive enums
+// error
+// backend=stage1
+// target=native
+// is_test=1
 //
 // tmp.zig:12:5: error: enumeration value 'E.b' not handled in switch
 // tmp.zig:16:5: error: switch on non-exhaustive enum must include `else` or `_` prong
test/compile_errors/stage1/test/tagName_on_invalid_value_of_non-exhaustive_enum.zig
@@ -3,6 +3,9 @@ test "enum" {
     _ = @tagName(@intToEnum(E, 5));
 }
 
-// @tagName on invalid value of non-exhaustive enum
+// error
+// backend=stage1
+// target=native
+// is_test=1
 //
 // tmp.zig:3:18: error: no tag by value 5
test/compile_errors/stage1/test/type_mismatch_in_C_prototype_with_varargs.zig
@@ -6,6 +6,9 @@ export fn main() void {
     _ = x;
 }
 
-// type mismatch in C prototype with varargs
+// error
+// backend=stage1
+// target=native
+// is_test=1
 //
 // tmp.zig:5:22: error: expected type 'fn([*c]u8, ...) callconv(.C) void', found 'fn([*:0]u8, ...) callconv(.C) void'
test/compile_errors/stage1/test/type_mismatch_with_tuple_concatenation.zig
@@ -3,6 +3,9 @@ export fn entry() void {
     x = x ++ .{ 1, 2, 3 };
 }
 
-// type mismatch with tuple concatenation
+// error
+// backend=stage1
+// target=native
+// is_test=1
 //
 // tmp.zig:3:11: error: expected type 'struct:2:14', found 'struct:3:11'
test/compile_errors/stage2/constant_inside_comptime_function_has_compile_error.zig
@@ -15,6 +15,7 @@ export fn entry() void {
 }
 
 // error
+// target=native
 //
 // :4:5: error: unreachable code
 // :4:25: note: control flow is diverted here
test/compile_errors/stage2/duplicate-unused_labels.zig
@@ -18,6 +18,7 @@ comptime {
 }
 
 // error
+// target=native
 //
 // :2:12: error: redefinition of label 'blk'
 // :2:5: note: previous definition here
test/compile_errors/stage2/embed_outside_package.zig
@@ -3,5 +3,6 @@ export fn a() usize {
 }
 
 // error
+// target=native
 //
 //:2:23: error: embed of file outside package path: '/root/foo'
test/compile_errors/stage2/import_outside_package.zig
@@ -3,5 +3,6 @@ export fn a() usize {
 }
 
 // error
+// target=native
 //
 // :2:20: error: import of file outside package path: '../../above.zig'
test/compile_errors/stage2/out_of_bounds_index.zig
@@ -21,6 +21,7 @@ comptime {
 }
 
 // error
+// target=native
 //
 // :4:26: error: end index 6 out of bounds for slice of length 4 +1 (sentinel)
 // :9:22: error: end index 6 out of bounds for array of length 4 +1 (sentinel)
test/compile_errors/stage2/slice_of_null_pointer.zig
@@ -6,5 +6,6 @@ comptime {
 }
 
 // error
+// target=native
 //
 // :4:14: error: slice of null pointer
test/compile_errors/stage2/struct_duplicate_field_name.zig
@@ -9,6 +9,7 @@ export fn entry() void {
 }
 
 // error
+// target=native
 //
 // :3:5: error: duplicate struct field: 'foo'
 // :2:5: note: other field here
test/compile_errors/stage2/union_access_of_inactive_field.zig
@@ -9,6 +9,7 @@ comptime {
 }
 
 // error
+// target=native
 //
 // :7:16: error: access of union field 'b' while field 'a' is active
 // :1:11: note: union declared here
test/compile_errors/stage2/union_duplicate_enum_field.zig
@@ -10,6 +10,7 @@ export fn foo() void {
 }
 
 // error
+// target=native
 //
 // :4:5: error: duplicate union field: 'a'
 // :3:5: note: other field here
test/compile_errors/stage2/union_duplicate_field_definition.zig
@@ -9,6 +9,7 @@ export fn entry() void {
 }
 
 // error
+// target=native
 //
 // :3:5: error: duplicate union field: 'foo'
 // :2:5: note: other field here
test/compile_errors/stage2/union_enum_field_missing.zig
@@ -14,6 +14,7 @@ export fn entry() usize {
 }
 
 // error
+// target=native
 //
 // :7:1: error: enum field(s) missing in union
 // :4:5: note: field 'c' missing, declared here
test/compile_errors/stage2/union_extra_field.zig
@@ -14,6 +14,7 @@ export fn entry() usize {
 }
 
 // error
+// target=native
 //
 // :6:1: error: enum 'tmp.E' has no field named 'd'
 // :1:11: note: enum declared here
test/compile_errors/stage2/union_runtime_coercion_from_enum.zig
@@ -15,6 +15,7 @@ export fn doTheTest() u64 {
 }
 
 // error
+// target=native
 //
 // :13:19: error: runtime coercion from enum 'tmp.E' to union 'tmp.U' which has non-void fields
 // :6:5: note: field 'a' has type 'u32'
test/cases.zig
@@ -1,11 +1,6 @@
 const std = @import("std");
 const TestContext = @import("../src/test.zig").TestContext;
 
-// Self-hosted has differing levels of support for various architectures. For now we pass explicit
-// target parameters to each test case. At some point we will take this to the next level and have
-// a set of targets that all test cases run on unless specifically overridden. For now, each test
-// case applies to only the specified target.
-
 pub fn addCases(ctx: *TestContext) !void {
     try @import("compile_errors.zig").addCases(ctx);
     try @import("stage2/cbe.zig").addCases(ctx);
test/compile_errors.zig
@@ -3,207 +3,6 @@ const builtin = @import("builtin");
 const TestContext = @import("../src/test.zig").TestContext;
 
 pub fn addCases(ctx: *TestContext) !void {
-    {
-        const case = ctx.obj("callconv(.Interrupt) on unsupported platform", .{
-            .cpu_arch = .aarch64,
-            .os_tag = .linux,
-            .abi = .none,
-        });
-        case.backend = .stage1;
-        case.addError(
-            \\export fn entry() callconv(.Interrupt) void {}
-        , &[_][]const u8{
-            "tmp.zig:1:28: error: callconv 'Interrupt' is only available on x86, x86_64, AVR, and MSP430, not aarch64",
-        });
-    }
-    {
-        var case = ctx.obj("callconv(.Signal) on unsupported platform", .{
-            .cpu_arch = .x86_64,
-            .os_tag = .linux,
-            .abi = .none,
-        });
-        case.backend = .stage1;
-        case.addError(
-            \\export fn entry() callconv(.Signal) void {}
-        , &[_][]const u8{
-            "tmp.zig:1:28: error: callconv 'Signal' is only available on AVR, not x86_64",
-        });
-    }
-    {
-        const case = ctx.obj("callconv(.Stdcall, .Fastcall, .Thiscall) on unsupported platform", .{
-            .cpu_arch = .x86_64,
-            .os_tag = .linux,
-            .abi = .none,
-        });
-        case.backend = .stage1;
-        case.addError(
-            \\const F1 = fn () callconv(.Stdcall) void;
-            \\const F2 = fn () callconv(.Fastcall) void;
-            \\const F3 = fn () callconv(.Thiscall) void;
-            \\export fn entry1() void { var a: F1 = undefined; _ = a; }
-            \\export fn entry2() void { var a: F2 = undefined; _ = a; }
-            \\export fn entry3() void { var a: F3 = undefined; _ = a; }
-        , &[_][]const u8{
-            "tmp.zig:1:27: error: callconv 'Stdcall' is only available on x86, not x86_64",
-            "tmp.zig:2:27: error: callconv 'Fastcall' is only available on x86, not x86_64",
-            "tmp.zig:3:27: error: callconv 'Thiscall' is only available on x86, not x86_64",
-        });
-    }
-    {
-        const case = ctx.obj("callconv(.Stdcall, .Fastcall, .Thiscall) on unsupported platform", .{
-            .cpu_arch = .x86_64,
-            .os_tag = .linux,
-            .abi = .none,
-        });
-        case.backend = .stage1;
-        case.addError(
-            \\export fn entry1() callconv(.Stdcall) void {}
-            \\export fn entry2() callconv(.Fastcall) void {}
-            \\export fn entry3() callconv(.Thiscall) void {}
-        , &[_][]const u8{
-            "tmp.zig:1:29: error: callconv 'Stdcall' is only available on x86, not x86_64",
-            "tmp.zig:2:29: error: callconv 'Fastcall' is only available on x86, not x86_64",
-            "tmp.zig:3:29: error: callconv 'Thiscall' is only available on x86, not x86_64",
-        });
-    }
-    {
-        const case = ctx.obj("callconv(.Vectorcall) on unsupported platform", .{
-            .cpu_arch = .x86_64,
-            .os_tag = .linux,
-            .abi = .none,
-        });
-        case.backend = .stage1;
-        case.addError(
-            \\export fn entry() callconv(.Vectorcall) void {}
-        , &[_][]const u8{
-            "tmp.zig:1:28: error: callconv 'Vectorcall' is only available on x86 and AArch64, not x86_64",
-        });
-    }
-    {
-        const case = ctx.obj("callconv(.APCS, .AAPCS, .AAPCSVFP) on unsupported platform", .{
-            .cpu_arch = .x86_64,
-            .os_tag = .linux,
-            .abi = .none,
-        });
-        case.backend = .stage1;
-        case.addError(
-            \\export fn entry1() callconv(.APCS) void {}
-            \\export fn entry2() callconv(.AAPCS) void {}
-            \\export fn entry3() callconv(.AAPCSVFP) void {}
-        , &[_][]const u8{
-            "tmp.zig:1:29: error: callconv 'APCS' is only available on ARM, not x86_64",
-            "tmp.zig:2:29: error: callconv 'AAPCS' is only available on ARM, not x86_64",
-            "tmp.zig:3:29: error: callconv 'AAPCSVFP' is only available on ARM, not x86_64",
-        });
-    }
-
-    {
-        const case = ctx.obj("call with new stack on unsupported target", .{
-            .cpu_arch = .wasm32,
-            .os_tag = .wasi,
-            .abi = .none,
-        });
-        case.backend = .stage1;
-        case.addError(
-            \\var buf: [10]u8 align(16) = undefined;
-            \\export fn entry() void {
-            \\    @call(.{.stack = &buf}, foo, .{});
-            \\}
-            \\fn foo() void {}
-        , &[_][]const u8{
-            "tmp.zig:3:5: error: target arch 'wasm32' does not support calling with a new stack",
-        });
-    }
-
-    // Note: One of the error messages here is backwards. It would be nice to fix, but that's not
-    // going to stop me from merging this branch which fixes a bunch of other stuff.
-    ctx.objErrStage1("incompatible sentinels",
-        \\export fn entry1(ptr: [*:255]u8) [*:0]u8 {
-        \\    return ptr;
-        \\}
-        \\export fn entry2(ptr: [*]u8) [*:0]u8 {
-        \\    return ptr;
-        \\}
-        \\export fn entry3() void {
-        \\    var array: [2:0]u8 = [_:255]u8{1, 2};
-        \\    _ = array;
-        \\}
-        \\export fn entry4() void {
-        \\    var array: [2:0]u8 = [_]u8{1, 2};
-        \\    _ = array;
-        \\}
-    , &[_][]const u8{
-        "tmp.zig:2:12: error: expected type '[*:0]u8', found '[*:255]u8'",
-        "tmp.zig:2:12: note: destination pointer requires a terminating '0' sentinel, but source pointer has a terminating '255' sentinel",
-        "tmp.zig:5:12: error: expected type '[*:0]u8', found '[*]u8'",
-        "tmp.zig:5:12: note: destination pointer requires a terminating '0' sentinel",
-
-        "tmp.zig:8:35: error: expected type '[2:255]u8', found '[2:0]u8'",
-        "tmp.zig:8:35: note: destination array requires a terminating '255' sentinel, but source array has a terminating '0' sentinel",
-        "tmp.zig:12:31: error: expected type '[2:0]u8', found '[2]u8'",
-        "tmp.zig:12:31: note: destination array requires a terminating '0' sentinel",
-    });
-
-    {
-        const case = ctx.obj("variable in inline assembly template cannot be found", .{
-            .cpu_arch = .x86_64,
-            .os_tag = .linux,
-            .abi = .gnu,
-        });
-        case.backend = .stage1;
-        case.addError(
-            \\export fn entry() void {
-            \\    var sp = asm volatile (
-            \\        "mov %[foo], sp"
-            \\        : [bar] "=r" (-> usize)
-            \\    );
-            \\    _ = sp;
-            \\}
-        , &[_][]const u8{
-            "tmp.zig:2:14: error: could not find 'foo' in the inputs or outputs",
-        });
-    }
-
-    {
-        const case = ctx.obj("bad alignment in @asyncCall", .{
-            .cpu_arch = .aarch64,
-            .os_tag = .linux,
-            .abi = .none,
-        });
-        case.backend = .stage1;
-        case.addError(
-            \\export fn entry() void {
-            \\    var ptr: fn () callconv(.Async) void = func;
-            \\    var bytes: [64]u8 = undefined;
-            \\    _ = @asyncCall(&bytes, {}, ptr, .{});
-            \\}
-            \\fn func() callconv(.Async) void {}
-        , &[_][]const u8{
-            "tmp.zig:4:21: error: expected type '[]align(8) u8', found '*[64]u8'",
-        });
-    }
-
-    if (builtin.os.tag == .linux) {
-        ctx.testErrStage1("implicit dependency on libc",
-            \\extern "c" fn exit(u8) void;
-            \\export fn entry() void {
-            \\    exit(0);
-            \\}
-        , &[_][]const u8{
-            "tmp.zig:3:5: error: dependency on libc must be explicitly specified in the build command",
-        });
-
-        ctx.testErrStage1("libc headers note",
-            \\const c = @cImport(@cInclude("stdio.h"));
-            \\export fn entry() void {
-            \\    _ = c.printf("hello, world!\n");
-            \\}
-        , &[_][]const u8{
-            "tmp.zig:1:11: error: C import failed",
-            "tmp.zig:1:11: note: libc headers not available; compilation does not link against libc",
-        });
-    }
-
     {
         const case = ctx.obj("wrong same named struct", .{});
         case.backend = .stage1;
@@ -366,21 +165,4 @@ pub fn addCases(ctx: *TestContext) !void {
     //, &[_][]const u8{
     //    "tmp.zig:4:1: error: unable to inline function",
     //});
-
-    {
-        const case = ctx.obj("align(N) expr function pointers is a compile error", .{
-            .cpu_arch = .wasm32,
-            .os_tag = .freestanding,
-            .abi = .none,
-        });
-        case.backend = .stage1;
-
-        case.addError(
-            \\export fn foo() align(1) void {
-            \\    return;
-            \\}
-        , &[_][]const u8{
-            "tmp.zig:1:23: error: align(N) expr is not allowed on function prototypes in wasm32/wasm64",
-        });
-    }
 }