about summary refs log tree commit diff
path: root/src/test/codegen/ffi-const.rs
blob: 440d022a12cba0ce3a6ba8cc5e466809e09f70dd (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 {
    // CHECK-LABEL: declare void @foo()
    // CHECK-SAME: [[ATTRS:#[0-9]+]]
    // CHECK-DAG: attributes [[ATTRS]] = { {{.*}}readnone{{.*}} }
    #[ffi_const] pub fn foo();
}