Files
TheRock/compiler/amd-llvm/clang/test/CIR/Lowering/func-simple.cpp
T
derek.holloway 7502bf64a4
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
Flatten subprojects into a single base monorepo
2026-09-02 16:34:47 -07:00

74 lines
2.2 KiB
C++

// Simple functions
// RUN: %clang_cc1 -std=c++20 -triple x86_64-unknown-linux-gnu -fclangir -emit-llvm %s -o - | FileCheck %s
void empty() { }
// CHECK: define{{.*}} void @_Z5emptyv()
// CHECK: ret void
void voidret() { return; }
// CHECK: define{{.*}} void @_Z7voidretv()
// CHECK: ret void
int intfunc() { return 42; }
// CHECK: define{{.*}} i32 @_Z7intfuncv()
// CHECK: %[[RV:.*]] = alloca i32, i64 1, align 4
// CHECK: store i32 42, ptr %[[RV]], align 4
// CHECK: %[[R:.*]] = load i32, ptr %[[RV]], align 4
// CHECK: ret i32 %[[R]]
int scopes() {
{
{
return 99;
}
}
}
// CHECK: define{{.*}} i32 @_Z6scopesv(){{.*}} {
// CHECK: %[[RV:.*]] = alloca i32, i64 1, align 4
// CHECK: br label %[[LABEL1:.*]]
// CHECK: [[LABEL1]]:
// CHECK: br label %[[LABEL2:.*]]
// CHECK: [[LABEL2]]:
// CHECK: store i32 99, ptr %[[RV]], align 4
// CHECK: %[[R:.*]] = load i32, ptr %[[RV]], align 4
// CHECK: ret i32 %[[R]]
// CHECK: [[LABEL3:.*]]:
// CHECK: br label %[[LABEL4:.*]]
// CHECK: [[LABEL4]]:
// CHECK: call void @llvm.trap()
// CHECK: unreachable
// CHECK: }
long longfunc() { return 42l; }
// CHECK: define{{.*}} i64 @_Z8longfuncv(){{.*}} {
// CHECK: %[[RV:.*]] = alloca i64, i64 1, align 8
// CHECK: store i64 42, ptr %[[RV]], align 8
// CHECK: %[[R:.*]] = load i64, ptr %[[RV]], align 8
// CHECK: ret i64 %[[R]]
// CHECK: }
unsigned unsignedfunc() { return 42u; }
// CHECK: define{{.*}} i32 @_Z12unsignedfuncv(){{.*}} {
// CHECK: %[[RV:.*]] = alloca i32, i64 1, align 4
// CHECK: store i32 42, ptr %[[RV]], align 4
// CHECK: %[[R:.*]] = load i32, ptr %[[RV]], align 4
// CHECK: ret i32 %[[R]]
// CHECK: }
unsigned long long ullfunc() { return 42ull; }
// CHECK: define{{.*}} i64 @_Z7ullfuncv(){{.*}} {
// CHECK: %[[RV:.*]] = alloca i64, i64 1, align 8
// CHECK: store i64 42, ptr %[[RV]], align 8
// CHECK: %[[R:.*]] = load i64, ptr %[[RV]], align 8
// CHECK: ret i64 %[[R]]
// CHECK: }
bool boolfunc() { return true; }
// CHECK: define{{.*}} i1 @_Z8boolfuncv(){{.*}} {
// CHECK: %[[RV:.*]] = alloca i8, i64 1, align 1
// CHECK: store i8 1, ptr %[[RV]], align 1
// CHECK: %[[R8:.*]] = load i8, ptr %[[RV]], align 1
// CHECK: %[[R:.*]] = trunc i8 %[[R8]] to i1
// CHECK: ret i1 %[[R]]
// CHECK: }