summaryrefslogtreecommitdiffstats
path: root/tests/codegen/cffi/ffi-pure.rs
blob: 2ed735813582f67138a6e92689509d06ae6c6b75 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
// compile-flags: -C no-prepopulate-passes
#![crate_type = "lib"]
#![feature(ffi_pure)]

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

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