about summary refs log tree commit diff
path: root/src/test/codegen
diff options
context:
space:
mode:
authorgnzlbg <gonzalobg88@gmail.com>2019-02-10 09:59:07 +0100
committergnzlbg <gonzalobg88@gmail.com>2019-02-23 15:48:40 +0100
commit76403e574231ae54dc7ccf227750af907ea13db3 (patch)
tree5fc2ce5ac74c5d9eac0c4482deadf09d30c7f57b /src/test/codegen
parent52ba07dbe64c47f3255169f57474a5336c7a389d (diff)
downloadrust-76403e574231ae54dc7ccf227750af907ea13db3.tar.gz
rust-76403e574231ae54dc7ccf227750af907ea13db3.zip
Use pattern to match attributes
Diffstat (limited to 'src/test/codegen')
-rw-r--r--src/test/codegen/ffi-returns-twice.rs14
1 files changed, 5 insertions, 9 deletions
diff --git a/src/test/codegen/ffi-returns-twice.rs b/src/test/codegen/ffi-returns-twice.rs
index f6648249eb6..396e8990d6f 100644
--- a/src/test/codegen/ffi-returns-twice.rs
+++ b/src/test/codegen/ffi-returns-twice.rs
@@ -2,14 +2,10 @@
 #![crate_type = "lib"]
 #![feature(ffi_returns_twice)]
 
-extern {
-    // CHECK-LABEL: @foo()
-    // CHECK: attributes #1 = { {{.*}}returns_twice{{.*}} }
-    #[no_mangle]
-    #[ffi_returns_twice]
-    pub fn foo();
-}
+pub fn bar() { unsafe { foo() } }
 
-pub fn bar() {
-    unsafe { foo() }
+extern {
+    #[ffi_returns_twice] pub fn foo();
 }
+// CHECK: declare void @foo(){{.*}}#1{{.*}}
+// CHECK: attributes #1 = { {{.*}}returns_twice{{.*}} }