rust/tests/codegen/ffi-const.rs

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

14 lines
417 B
Rust
Raw Normal View History

// compile-flags: -C no-prepopulate-passes
#![crate_type = "lib"]
#![feature(ffi_const)]
pub fn bar() { unsafe { foo() } }
2020-09-02 05:12:52 +08:00
extern "C" {
// CHECK-LABEL: declare{{.*}}void @foo()
// CHECK-SAME: [[ATTRS:#[0-9]+]]
2022-11-05 00:20:42 +08:00
// The attribute changed from `readnone` to `memory(none)` with LLVM 16.0.
// CHECK-DAG: attributes [[ATTRS]] = { {{.*}}{{readnone|memory\(none\)}}{{.*}} }
#[ffi_const] pub fn foo();
}