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