rust/tests/codegen/cffi/ffi-pure.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

16 lines
338 B
Rust
Raw Normal View History

//@ compile-flags: -C no-prepopulate-passes
#![crate_type = "lib"]
#![feature(ffi_pure)]
pub fn bar() {
unsafe { foo() }
}
2020-09-01 17:12:52 -04:00
extern "C" {
// CHECK-LABEL: declare{{.*}}void @foo()
// CHECK-SAME: [[ATTRS:#[0-9]+]]
2025-04-02 12:08:01 -07:00
// CHECK-DAG: attributes [[ATTRS]] = { {{.*}}memory(read){{.*}} }
#[unsafe(ffi_pure)]
pub fn foo();
}