2020-02-25 08:43:21 +00:00
|
|
|
const std = @import("std");
|
2021-10-05 07:47:27 +01:00
|
|
|
const builtin = @import("builtin");
|
2017-04-19 19:00:12 +01:00
|
|
|
const tests = @import("tests.zig");
|
|
|
|
|
2018-05-31 15:56:59 +01:00
|
|
|
pub fn addCases(cases: *tests.CompareOutputContext) void {
|
2021-10-05 07:47:27 +01:00
|
|
|
if (builtin.os.tag == .linux and builtin.cpu.arch == .x86_64) {
|
2017-04-19 19:00:12 +01:00
|
|
|
cases.addAsm("hello world linux x86_64",
|
|
|
|
\\.text
|
|
|
|
\\.globl _start
|
|
|
|
\\
|
|
|
|
\\_start:
|
2017-04-30 16:28:11 +01:00
|
|
|
\\ mov $1, %rax
|
|
|
|
\\ mov $1, %rdi
|
|
|
|
\\ mov $msg, %rsi
|
|
|
|
\\ mov $14, %rdx
|
2017-04-19 19:00:12 +01:00
|
|
|
\\ syscall
|
|
|
|
\\
|
2017-04-30 16:28:11 +01:00
|
|
|
\\ mov $60, %rax
|
|
|
|
\\ mov $0, %rdi
|
2017-04-19 19:00:12 +01:00
|
|
|
\\ syscall
|
|
|
|
\\
|
|
|
|
\\.data
|
|
|
|
\\msg:
|
|
|
|
\\ .ascii "Hello, world!\n"
|
|
|
|
, "Hello, world!\n");
|
|
|
|
}
|
|
|
|
}
|