diff options
| author | Flakebi <flakebi@t-online.de> | 2025-09-03 08:29:52 +0200 |
|---|---|---|
| committer | Flakebi <flakebi@t-online.de> | 2025-09-03 08:40:51 +0200 |
| commit | 485bdafdcfb340e74b7342d716b2135d4c6c8ca1 (patch) | |
| tree | 47a3776c1f9d4af90aa16f874fffcb7c5a0cdf2a /tests/codegen-llvm | |
| parent | 94722cabf4983abcbe5088c1b8e81517ba2a7126 (diff) | |
| download | rust-485bdafdcfb340e74b7342d716b2135d4c6c8ca1.tar.gz rust-485bdafdcfb340e74b7342d716b2135d4c6c8ca1.zip | |
Add test for addrspacecasting global vars
Global variables are casted to the default address space works, as the amdgpu target is now merged, a test can be added.
Diffstat (limited to 'tests/codegen-llvm')
| -rw-r--r-- | tests/codegen-llvm/amdgpu-addrspacecast.rs | 9 |
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); +} |
