about summary refs log tree commit diff
path: root/src/rt/rust_env.cpp
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2013-03-12 07:51:54 -0700
committerbors <bors@rust-lang.org>2013-03-12 07:51:54 -0700
commit34aaf350c2c38435a3b20d454b17f8fbbd2a1d8a (patch)
tree080d38a2c80450e956bffb75267deb1a114fed2e /src/rt/rust_env.cpp
parent014620af902c4798ede78462b2d0e3b749fb2fff (diff)
parent18b71a78314505b4dd3816f9662709860aafaf4c (diff)
downloadrust-34aaf350c2c38435a3b20d454b17f8fbbd2a1d8a.tar.gz
rust-34aaf350c2c38435a3b20d454b17f8fbbd2a1d8a.zip
auto merge of #5317 : luqmana/rust/inline-asm, r=graydon
```Rust
#[cfg(target_os = "macos")]
fn helloworld() {
    unsafe {
        asm!(".pushsection __RODATA, __rodata
                  msg: .asciz \"Hello World!\"
              .popsection
              movq msg@GOTPCREL(%rip), %rdi
              call _puts");
    }
}

#[cfg(target_os = "linux")]
fn helloworld() {
    unsafe {
        asm!(".pushsection .rodata
                  msg: .asciz \"Hello World!\"
              .popsection
              movq msg@GOTPCREL(%rip), %rdi
              call puts");
    }
}

fn main() {
    helloworld();
}
```

```
% rustc foo.rs
% ./foo
Hello World!
```
Diffstat (limited to 'src/rt/rust_env.cpp')
0 files changed, 0 insertions, 0 deletions