summaryrefslogtreecommitdiffstats
path: root/src/test/codegen/ffi-const.rs
blob: d9cfa5429b5bb72031bfe75ef70bc601f3452e83 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
// 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]+]]
    // CHECK-DAG: attributes [[ATTRS]] = { {{.*}}readnone{{.*}} }
    #[ffi_const] pub fn foo();
}