]>
Commit | Line | Data |
---|---|---|
c620b35d | 1 | //@ compile-flags: -C no-prepopulate-passes -Copt-level=0 |
ba9703b0 | 2 | |
c620b35d FG |
3 | //@ ignore-riscv64 |
4 | //@ ignore-loongarch64 | |
f035d41b | 5 | |
ba9703b0 XL |
6 | #![feature(link_llvm_intrinsics)] |
7 | #![crate_type = "lib"] | |
8 | ||
9 | struct A; | |
10 | ||
11 | impl Drop for A { | |
12 | fn drop(&mut self) { | |
13 | println!("A"); | |
14 | } | |
15 | } | |
16 | ||
5869c6ff | 17 | extern "C" { |
ba9703b0 XL |
18 | #[link_name = "llvm.sqrt.f32"] |
19 | fn sqrt(x: f32) -> f32; | |
20 | } | |
21 | ||
22 | pub fn do_call() { | |
23 | let _a = A; | |
24 | ||
25 | unsafe { | |
26 | // Ensure that we `call` LLVM intrinsics instead of trying to `invoke` them | |
27 | // CHECK: call float @llvm.sqrt.f32(float 4.000000e+00 | |
28 | sqrt(4.0); | |
29 | } | |
30 | } |