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

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

14 lines
416 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 16:12:52 -05:00
extern "C" {
// CHECK-LABEL: declare{{.*}}void @foo()
// CHECK-SAME: [[ATTRS:#[0-9]+]]
2022-11-04 11:20:42 -05:00
// The attribute changed from `readonly` to `memory(read)` with LLVM 16.0.
// CHECK-DAG: attributes [[ATTRS]] = { {{.*}}{{readonly|memory\(read\)}}{{.*}} }
#[ffi_pure] pub fn foo();
}