From 945cbe43235bf415d26701f246728f021a077b1d Mon Sep 17 00:00:00 2001 From: gnzlbg Date: Sun, 10 Feb 2019 10:01:05 +0100 Subject: [PATCH] Use pattern to match attributes --- src/test/codegen/ffi-const.rs | 11 +++-------- src/test/codegen/ffi-pure.rs | 6 ++---- 2 files changed, 5 insertions(+), 12 deletions(-) diff --git a/src/test/codegen/ffi-const.rs b/src/test/codegen/ffi-const.rs index 3574f776e3a6b..2e1cd5c812495 100644 --- a/src/test/codegen/ffi-const.rs +++ b/src/test/codegen/ffi-const.rs @@ -2,15 +2,10 @@ #![crate_type = "lib"] #![feature(ffi_const)] -// CHECK-LABEL: @bar() -#[no_mangle] pub fn bar() { unsafe { foo() } } - extern { - // CHECK-LABEL: @foo() unnamed_addr #1 - // CHECK: attributes #1 = { {{.*}}readnone{{.*}} } - #[no_mangle] - #[ffi_const] - pub fn foo(); + #[ffi_const] pub fn foo(); } +// CHECK: declare void @foo(){{.*}}#1{{.*}} +// CHECK: attributes #1 = { {{.*}}readnone{{.*}} } diff --git a/src/test/codegen/ffi-pure.rs b/src/test/codegen/ffi-pure.rs index 614e001c7a8d8..69bd77943d7de 100644 --- a/src/test/codegen/ffi-pure.rs +++ b/src/test/codegen/ffi-pure.rs @@ -2,12 +2,10 @@ #![crate_type = "lib"] #![feature(ffi_pure)] -// CHECK-LABEL: @bar() -#[no_mangle] pub fn bar() { unsafe { foo() } } extern { - // CHECK-LABEL: @foo() unnamed_addr #1 - // CHECK: attributes #1 = { {{.*}}readonly{{.*}} } #[ffi_pure] pub fn foo(); } +// CHECK: declare void @foo(){{.*}}#1{{.*}} +// CHECK: attributes #1 = { {{.*}}readonly{{.*}} }