Skip to content

Commit

Permalink
Use pattern to match attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
gnzlbg committed Feb 10, 2019
1 parent bf149c0 commit 945cbe4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 12 deletions.
11 changes: 3 additions & 8 deletions src/test/codegen/ffi-const.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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{{.*}} }
6 changes: 2 additions & 4 deletions src/test/codegen/ffi-pure.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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{{.*}} }

0 comments on commit 945cbe4

Please sign in to comment.