We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6a9115b commit 38de6b7Copy full SHA for 38de6b7
tests/codegen/amdgpu-addrspacecast.rs
@@ -0,0 +1,22 @@
1
+// Check that pointers are casted to addrspace(0) before they are used
2
+
3
+//@ compile-flags: --crate-type=rlib --target=amdgcn-amd-amdhsa -Ctarget-cpu=gfx900
4
+//@ needs-llvm-components: amdgpu
5
+#![feature(no_core, lang_items)]
6
+#![no_core]
7
8
+#[lang = "sized"]
9
+trait Sized {}
10
+#[lang = "freeze"]
11
+trait Freeze {}
12
+#[lang = "copy"]
13
+trait Copy {}
14
15
+// CHECK-LABEL: @ref_of_local
16
+// CHECK: [[alloca:%[0-9]]] = alloca
17
+// CHECK: %i = addrspacecast ptr addrspace(5) [[alloca]] to ptr
18
+#[no_mangle]
19
+pub fn ref_of_local(f: fn(&i32)) {
20
+ let i = 0;
21
+ f(&i);
22
+}
0 commit comments