| ... | @@ -5,7 +5,10 @@ const expect = std.testing.expect; | ... | @@ -5,7 +5,10 @@ const expect = std.testing.expect; |
| 5 | const is_x86_64_linux = builtin.cpu.arch == .x86_64 and builtin.os.tag == .linux; | 5 | const is_x86_64_linux = builtin.cpu.arch == .x86_64 and builtin.os.tag == .linux; |
| 6 | | 6 | |
| 7 | comptime { | 7 | comptime { |
| 8 | if (is_x86_64_linux) { | 8 | if (builtin.zig_backend != .stage2_arm and |
| | 9 | builtin.zig_backend != .stage2_aarch64 and |
| | 10 | is_x86_64_linux) |
| | 11 | { |
| 9 | asm ( | 12 | asm ( |
| 10 | \\.globl this_is_my_alias; | 13 | \\.globl this_is_my_alias; |
| 11 | \\.type this_is_my_alias, @function; | 14 | \\.type this_is_my_alias, @function; |
| ... | @@ -15,12 +18,26 @@ comptime { | ... | @@ -15,12 +18,26 @@ comptime { |
| 15 | } | 18 | } |
| 16 | | 19 | |
| 17 | test "module level assembly" { | 20 | test "module level assembly" { |
| | 21 | if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; // TODO |
| | 22 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO |
| | 23 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO |
| | 24 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| | 25 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO |
| | 26 | if (builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; // TODO |
| | 27 | |
| 18 | if (is_x86_64_linux) { | 28 | if (is_x86_64_linux) { |
| 19 | try expect(this_is_my_alias() == 1234); | 29 | try expect(this_is_my_alias() == 1234); |
| 20 | } | 30 | } |
| 21 | } | 31 | } |
| 22 | | 32 | |
| 23 | test "output constraint modifiers" { | 33 | test "output constraint modifiers" { |
| | 34 | if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; // TODO |
| | 35 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO |
| | 36 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO |
| | 37 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| | 38 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO |
| | 39 | if (builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; // TODO |
| | 40 | |
| 24 | // This is only testing compilation. | 41 | // This is only testing compilation. |
| 25 | var a: u32 = 3; | 42 | var a: u32 = 3; |
| 26 | asm volatile ("" | 43 | asm volatile ("" |
| ... | @@ -36,6 +53,13 @@ test "output constraint modifiers" { | ... | @@ -36,6 +53,13 @@ test "output constraint modifiers" { |
| 36 | } | 53 | } |
| 37 | | 54 | |
| 38 | test "alternative constraints" { | 55 | test "alternative constraints" { |
| | 56 | if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; // TODO |
| | 57 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO |
| | 58 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO |
| | 59 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| | 60 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO |
| | 61 | if (builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; // TODO |
| | 62 | |
| 39 | // Make sure we allow commas as a separator for alternative constraints. | 63 | // Make sure we allow commas as a separator for alternative constraints. |
| 40 | var a: u32 = 3; | 64 | var a: u32 = 3; |
| 41 | asm volatile ("" | 65 | asm volatile ("" |
| ... | @@ -46,6 +70,11 @@ test "alternative constraints" { | ... | @@ -46,6 +70,11 @@ test "alternative constraints" { |
| 46 | } | 70 | } |
| 47 | | 71 | |
| 48 | test "sized integer/float in asm input" { | 72 | test "sized integer/float in asm input" { |
| | 73 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO |
| | 74 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO |
| | 75 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| | 76 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO |
| | 77 | |
| 49 | asm volatile ("" | 78 | asm volatile ("" |
| 50 | : | 79 | : |
| 51 | : [_] "m" (@as(usize, 3)), | 80 | : [_] "m" (@as(usize, 3)), |
| ... | @@ -89,6 +118,13 @@ test "sized integer/float in asm input" { | ... | @@ -89,6 +118,13 @@ test "sized integer/float in asm input" { |
| 89 | } | 118 | } |
| 90 | | 119 | |
| 91 | test "struct/array/union types as input values" { | 120 | test "struct/array/union types as input values" { |
| | 121 | if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; // TODO |
| | 122 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO |
| | 123 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO |
| | 124 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| | 125 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO |
| | 126 | if (builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; // TODO |
| | 127 | |
| 92 | asm volatile ("" | 128 | asm volatile ("" |
| 93 | : | 129 | : |
| 94 | : [_] "m" (@as([1]u32, undefined)), | 130 | : [_] "m" (@as([1]u32, undefined)), |