]> git.proxmox.com Git - rustc.git/blob - tests/codegen/ffi-const.rs
New upstream version 1.68.2+dfsg1
[rustc.git] / tests / codegen / ffi-const.rs
1 // compile-flags: -C no-prepopulate-passes
2 #![crate_type = "lib"]
3 #![feature(ffi_const)]
4
5 pub fn bar() { unsafe { foo() } }
6
7 extern "C" {
8 // CHECK-LABEL: declare{{.*}}void @foo()
9 // CHECK-SAME: [[ATTRS:#[0-9]+]]
10 // The attribute changed from `readnone` to `memory(none)` with LLVM 16.0.
11 // CHECK-DAG: attributes [[ATTRS]] = { {{.*}}{{readnone|memory\(none\)}}{{.*}} }
12 #[ffi_const] pub fn foo();
13 }