about summary refs log tree commit diff
path: root/tests/codegen-llvm/cffi/ffi-pure.rs
blob: a61e80ecf6529cd173c51f3498fa03413e05249f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
//@ 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]+]]
    // CHECK-DAG: attributes [[ATTRS]] = { {{.*}}memory(read){{.*}} }
    #[unsafe(ffi_pure)]
    pub fn foo();
}