[clang] Implement lifetime analysis for lifetime_capture_by(X) (#115921)
[llvm-project.git] / clang / test / CodeGenOpenCL / builtins-amdgcn-gfx950.cl
blobf31ba85a52a7adeca05272a2e28fbf768af2b9b9
1 // NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py
2 // RUN: %clang_cc1 -cl-std=CL1.2 -O0 -triple amdgcn-unknown-unknown -target-cpu gfx950 -emit-llvm -o - %s | FileCheck %s
3 // REQUIRES: amdgpu-registered-target
5 typedef unsigned int uint;
7 // CHECK-LABEL: @test_prng_b32(
8 // CHECK-NEXT: entry:
9 // CHECK-NEXT: [[OUT_ADDR:%.*]] = alloca ptr addrspace(1), align 8, addrspace(5)
10 // CHECK-NEXT: [[A_ADDR:%.*]] = alloca i32, align 4, addrspace(5)
11 // CHECK-NEXT: store ptr addrspace(1) [[OUT:%.*]], ptr addrspace(5) [[OUT_ADDR]], align 8
12 // CHECK-NEXT: store i32 [[A:%.*]], ptr addrspace(5) [[A_ADDR]], align 4
13 // CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr addrspace(5) [[A_ADDR]], align 4
14 // CHECK-NEXT: [[TMP1:%.*]] = call i32 @llvm.amdgcn.prng.b32(i32 [[TMP0]])
15 // CHECK-NEXT: [[TMP2:%.*]] = load ptr addrspace(1), ptr addrspace(5) [[OUT_ADDR]], align 8
16 // CHECK-NEXT: store i32 [[TMP1]], ptr addrspace(1) [[TMP2]], align 4
17 // CHECK-NEXT: ret void
19 void test_prng_b32(global uint* out, uint a) {
20 *out = __builtin_amdgcn_prng_b32(a);