about summary refs log tree commit diff
path: root/src/test/codegen
diff options
context:
space:
mode:
authorCensoredUsername <cens.username@gmail.com>2016-08-27 15:14:51 +0200
committerCensoredUsername <cens.username@gmail.com>2016-08-30 16:03:06 +0200
commit0e58a5d139772404ab936b6c7679e9ff936101c4 (patch)
tree2453b34c80fde922db92e9fb212730d6f5bba2a7 /src/test/codegen
parent30c4173cb8f942afbb1588174e5867eb780cdaa0 (diff)
downloadrust-0e58a5d139772404ab936b6c7679e9ff936101c4.tar.gz
rust-0e58a5d139772404ab936b6c7679e9ff936101c4.zip
Feature gate the sysv64 abi as feature(abi_sysv64) and add tests
Diffstat (limited to 'src/test/codegen')
-rw-r--r--src/test/codegen/abi-sysv64.rs24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/test/codegen/abi-sysv64.rs b/src/test/codegen/abi-sysv64.rs
new file mode 100644
index 00000000000..2b8e8a1b6b2
--- /dev/null
+++ b/src/test/codegen/abi-sysv64.rs
@@ -0,0 +1,24 @@
+// Copyright 2016 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+// Checks if the correct annotation for the sysv64 ABI is passed to
+// llvm. Also checks that the abi-sysv64 feature gate allows usage
+// of the sysv64 abi.
+
+// compile-flags: -C no-prepopulate-passes
+
+#![crate_type = "lib"]
+#![feature(abi_sysv64)]
+
+// CHECK: define x86_64_sysvcc i64 @has_sysv64_abi
+#[no_mangle]
+pub extern "sysv64" fn has_sysv64_abi(a: i64) -> i64 {
+    a * 2
+}