diff options
Diffstat (limited to 'cc/cc-test')
-rw-r--r-- | cc/cc-test/build.rs | 20 | ||||
-rw-r--r-- | cc/cc-test/src/aarch64.S | 10 |
2 files changed, 18 insertions, 12 deletions
diff --git a/cc/cc-test/build.rs b/cc/cc-test/build.rs index 5a7b178..677161e 100644 --- a/cc/cc-test/build.rs +++ b/cc/cc-test/build.rs @@ -25,12 +25,12 @@ fn main() { let target = std::env::var("TARGET").unwrap(); let file = target.split("-").next().unwrap(); - let file = format!("src/{}.{}", - file, - if target.contains("msvc") { "asm" } else { "S" }); - cc::Build::new() - .file(file) - .compile("asm"); + let file = format!( + "src/{}.{}", + file, + if target.contains("msvc") { "asm" } else { "S" } + ); + cc::Build::new().file(file).compile("asm"); cc::Build::new() .file("src/baz.cpp") @@ -38,9 +38,7 @@ fn main() { .compile("baz"); if target.contains("windows") { - cc::Build::new() - .file("src/windows.c") - .compile("windows"); + cc::Build::new().file("src/windows.c").compile("windows"); } // Test that the `windows_registry` module will set PATH by looking for @@ -86,9 +84,7 @@ fn main() { .file("src/opt_linkage.c") .compile("OptLinkage"); - let out = cc::Build::new() - .file("src/expand.c") - .expand(); + let out = cc::Build::new().file("src/expand.c").expand(); let out = String::from_utf8(out).unwrap(); assert!(out.contains("hello world")); } diff --git a/cc/cc-test/src/aarch64.S b/cc/cc-test/src/aarch64.S new file mode 100644 index 0000000..1d9062d --- /dev/null +++ b/cc/cc-test/src/aarch64.S @@ -0,0 +1,10 @@ +.globl asm +asm: + mov w0, 7 + ret + +.globl _asm +_asm: + mov w0, 7 + ret + |