about summary refs log tree commit diff
path: root/tests/codegen-llvm/amdgpu-addrspacecast.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/codegen-llvm/amdgpu-addrspacecast.rs')
-rw-r--r--tests/codegen-llvm/amdgpu-addrspacecast.rs9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/codegen-llvm/amdgpu-addrspacecast.rs b/tests/codegen-llvm/amdgpu-addrspacecast.rs
index 7fe630a7efa..829133de00d 100644
--- a/tests/codegen-llvm/amdgpu-addrspacecast.rs
+++ b/tests/codegen-llvm/amdgpu-addrspacecast.rs
@@ -16,3 +16,12 @@ pub fn ref_of_local(f: fn(&i32)) {
     let i = 0;
     f(&i);
 }
+
+// CHECK-LABEL: @ref_of_global
+// CHECK: addrspacecast (ptr addrspace(1) @I to ptr)
+#[no_mangle]
+pub fn ref_of_global(f: fn(&i32)) {
+    #[no_mangle]
+    static I: i32 = 0;
+    f(&I);
+}