Files
TheRock/compiler/amd-llvm/clang/test/Frontend/fixed_point_to_bool.c
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

54 lines
1.8 KiB
C

// RUN: %clang_cc1 -ffixed-point -emit-llvm %s -o - | FileCheck %s
// RUN: %clang_cc1 -ffixed-point -emit-llvm %s -o - -fpadding-on-unsigned-fixed-point | FileCheck %s
_Bool global_b = 1.0k; // @global_b = {{*.}}global i8 1, align 1
_Bool global_b2 = 0.0k; // @global_b2 = {{*.}}global i8 0, align 1
void func(void) {
_Accum a = 0.5k;
unsigned _Accum ua = 0.5uk;
_Bool b;
// CHECK: store i8 1, ptr %b, align 1
// CHECK-NEXT: store i8 0, ptr %b, align 1
// CHECK: store i8 1, ptr %b, align 1
// CHECK-NEXT: store i8 0, ptr %b, align 1
b = 0.5k;
b = 0.0k;
b = 0.5uk;
b = 0.0uk;
// CHECK-NEXT: store i8 1, ptr %b, align 1
// CHECK-NEXT: store i8 0, ptr %b, align 1
// CHECK-NEXT: store i8 1, ptr %b, align 1
// CHECK-NEXT: store i8 0, ptr %b, align 1
b = (_Bool)0.5r;
b = (_Bool)0.0r;
b = (_Bool)0.5ur;
b = (_Bool)0.0ur;
// CHECK-NEXT: [[ACCUM:%[0-9a-z]+]] = load i32, ptr %a, align 4
// CHECK-NEXT: [[NOTZERO:%[0-9a-z]+]] = icmp ne i32 [[ACCUM]], 0
// CHECK-NEXT: [[FROMBOOL:%[0-9a-z]+]] = zext i1 [[NOTZERO]] to i8
// CHECK-NEXT: store i8 [[FROMBOOL]], ptr %b, align 1
b = a;
// CHECK-NEXT: [[ACCUM:%[0-9a-z]+]] = load i32, ptr %ua, align 4
// CHECK-NEXT: [[NOTZERO:%[0-9a-z]+]] = icmp ne i32 [[ACCUM]], 0
// CHECK-NEXT: [[FROMBOOL:%[0-9a-z]+]] = zext i1 [[NOTZERO]] to i8
// CHECK-NEXT: store i8 [[FROMBOOL]], ptr %b, align 1
b = ua;
// CHECK-NEXT: [[ACCUM:%[0-9a-z]+]] = load i32, ptr %a, align 4
// CHECK-NEXT: [[NOTZERO:%[0-9a-z]+]] = icmp ne i32 [[ACCUM]], 0
// CHECK-NEXT: br i1 [[NOTZERO]], label %if.then, label %if.end
if (a) {
}
// CHECK: [[ACCUM:%[0-9a-z]+]] = load i32, ptr %ua, align 4
// CHECK-NEXT: [[NOTZERO:%[0-9a-z]+]] = icmp ne i32 [[ACCUM]], 0
// CHECK-NEXT: br i1 [[NOTZERO]], label %if.then{{[0-9]+}}, label %if.end{{[0-9]+}}
if (ua) {
}
}