summary refs log tree commit diff
path: root/tests/codegen/cffi/ffi-const.rs
blob: 564b8f7f8d8d2325f00c36206d8530bca5a9fcb9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
//@ compile-flags: -C no-prepopulate-passes
#![crate_type = "lib"]
#![feature(ffi_const)]

pub fn bar() {
    unsafe { foo() }
}

extern "C" {
    // CHECK-LABEL: declare{{.*}}void @foo()
    // CHECK-SAME: [[ATTRS:#[0-9]+]]
    // The attribute changed from `readnone` to `memory(none)` with LLVM 16.0.
    // CHECK-DAG: attributes [[ATTRS]] = { {{.*}}{{readnone|memory\(none\)}}{{.*}} }
    #[ffi_const]
    pub fn foo();
}