CodeQL / Analyze (actions) (push) Canceled after 0s
CodeQL / Analyze (python) (push) Canceled after 0s
pre-commit / pre-commit (push) Canceled after 0s
Multi-Arch CI / setup (push) Canceled after 0s
Publish build_manylinux_x86_64 images / publish_build_manylinux_x86_64 (push) Canceled after 0s
Setup (Multi-Arch) / setup (push) Canceled after 0s
Multi-Arch CI / Linux::${{ fromJSON(needs.setup.outputs.linux_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubi10 image / publish_no_rocm_image_ubi10 (push) Canceled after 0s
Multi-Arch CI / Windows::${{ fromJSON(needs.setup.outputs.windows_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Multi-Arch CI / Manifest Diff (push) Canceled after 0s
TheRock Manifest Diff Report / Generate Manifest Diff Report (push) Canceled after 0s
Multi-Arch CI / CI Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_ocl_rt images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_rocgdb images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Unit Tests / Unit Tests :: ubuntu-24.04 (push) Canceled after 0s
Unit Tests / Unit Tests :: windows-2022 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_media (push) Canceled after 0s
Unit Tests / Unit Tests Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_openmpi (push) Canceled after 0s
47 lines
2.3 KiB
C++
47 lines
2.3 KiB
C++
// RUN: %clang_cc1 -std=c++17 -triple x86_64-unknown-linux-gnu %s -fclangir -emit-cir -o %t.cir
|
|
// RUN: FileCheck --input-file=%t.cir -check-prefix=CIR %s
|
|
// RUN: %clang_cc1 -std=c++17 -triple x86_64-unknown-linux-gnu %s -fclangir -emit-llvm -o %t-cir.ll
|
|
// RUN: FileCheck --input-file=%t-cir.ll -check-prefix=LLVM %s
|
|
// RUN: %clang_cc1 -std=c++17 -triple x86_64-unknown-linux-gnu %s -emit-llvm -o %t.ll
|
|
// RUN: FileCheck --input-file=%t.ll -check-prefix=OGCG %s
|
|
|
|
void t1() {
|
|
int *p1 = nullptr;
|
|
int *p2 = 0;
|
|
int *p3 = (int*)0;
|
|
}
|
|
|
|
// CIR: cir.func{{.*}} @_Z2t1v()
|
|
// CIR-NEXT: %[[P1:.*]] = cir.alloca !cir.ptr<!s32i>, !cir.ptr<!cir.ptr<!s32i>>, ["p1", init] {alignment = 8 : i64}
|
|
// CIR-NEXT: %[[P2:.*]] = cir.alloca !cir.ptr<!s32i>, !cir.ptr<!cir.ptr<!s32i>>, ["p2", init] {alignment = 8 : i64}
|
|
// CIR-NEXT: %[[P3:.*]] = cir.alloca !cir.ptr<!s32i>, !cir.ptr<!cir.ptr<!s32i>>, ["p3", init] {alignment = 8 : i64}
|
|
// CIR-NEXT: %[[NULLPTR1:.*]] = cir.const #cir.ptr<null> : !cir.ptr<!s32i>
|
|
// CIR-NEXT: cir.store{{.*}} %[[NULLPTR1]], %[[P1]] : !cir.ptr<!s32i>, !cir.ptr<!cir.ptr<!s32i>>
|
|
// CIR-NEXT: %[[NULLPTR2:.*]] = cir.const #cir.ptr<null> : !cir.ptr<!s32i>
|
|
// CIR-NEXT: cir.store{{.*}} %[[NULLPTR2]], %[[P2]] : !cir.ptr<!s32i>, !cir.ptr<!cir.ptr<!s32i>>
|
|
// CIR-NEXT: %[[NULLPTR3:.*]] = cir.const #cir.ptr<null> : !cir.ptr<!s32i>
|
|
// CIR-NEXT: cir.store{{.*}} %[[NULLPTR3]], %[[P3]] : !cir.ptr<!s32i>, !cir.ptr<!cir.ptr<!s32i>>
|
|
// CIR-NEXT: cir.return
|
|
// CIR-NEXT: }
|
|
|
|
// LLVM: define{{.*}} @_Z2t1v()
|
|
// LLVM-NEXT: %[[P1:.*]] = alloca ptr, i64 1, align 8
|
|
// LLVM-NEXT: %[[P2:.*]] = alloca ptr, i64 1, align 8
|
|
// LLVM-NEXT: %[[P3:.*]] = alloca ptr, i64 1, align 8
|
|
// LLVM-NEXT: store ptr null, ptr %[[P1]], align 8
|
|
// LLVM-NEXT: store ptr null, ptr %[[P2]], align 8
|
|
// LLVM-NEXT: store ptr null, ptr %[[P3]], align 8
|
|
// LLVM-NEXT: ret void
|
|
// LLVM-NEXT: }
|
|
|
|
// OGCG: define{{.*}} @_Z2t1v()
|
|
// OGCG-NEXT: entry:
|
|
// OGCG-NEXT: %[[P1:.*]] = alloca ptr, align 8
|
|
// OGCG-NEXT: %[[P2:.*]] = alloca ptr, align 8
|
|
// OGCG-NEXT: %[[P3:.*]] = alloca ptr, align 8
|
|
// OGCG-NEXT: store ptr null, ptr %[[P1]], align 8
|
|
// OGCG-NEXT: store ptr null, ptr %[[P2]], align 8
|
|
// OGCG-NEXT: store ptr null, ptr %[[P3]], align 8
|
|
// OGCG-NEXT: ret void
|
|
// OGCG-NEXT: }
|