2017-05-01 18:12:38 +01:00
|
|
|
const builtin = @import("builtin");
|
2017-04-19 19:00:12 +01:00
|
|
|
const tests = @import("tests.zig");
|
|
|
|
|
|
|
|
pub fn addCases(cases: &tests.CompareOutputContext) {
|
2017-05-01 18:12:38 +01:00
|
|
|
if (builtin.os == builtin.Os.linux and builtin.arch == builtin.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");
|
|
|
|
}
|
|
|
|
}
|