zig/test/assemble_and_link.zig
Andrew Kelley 29defd705d back to AT&T syntax for assembly
this reverts 5c04730534.

sadly the quality of the intel dialect in llvm's assembly
parser has many frustrating bugs, and generally has unfortunate
syntax.

the plan is to use AT&T for now since it at least works,
and eventually zig will have its own assembly parser for
x86 and it will be as close to NASM as possible.
2017-04-30 11:28:11 -04:00

26 lines
697 B
Zig

const tests = @import("tests.zig");
pub fn addCases(cases: &tests.CompareOutputContext) {
if (@compileVar("os") == Os.linux and @compileVar("arch") == Arch.x86_64) {
cases.addAsm("hello world linux x86_64",
\\.text
\\.globl _start
\\
\\_start:
\\ mov $1, %rax
\\ mov $1, %rdi
\\ mov $msg, %rsi
\\ mov $14, %rdx
\\ syscall
\\
\\ mov $60, %rax
\\ mov $0, %rdi
\\ syscall
\\
\\.data
\\msg:
\\ .ascii "Hello, world!\n"
, "Hello, world!\n");
}
}