Files
TheRock/compiler/amd-llvm/compiler-rt/test/builtins/Unit/ashldi3_test.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

68 lines
2.1 KiB
C

// RUN: %clang_builtins %s %librt -o %t && %run %t
// REQUIRES: librt_has_ashldi3
#include "int_lib.h"
#include <stdio.h>
// Returns: a << b
// Precondition: 0 <= b < bits_in_dword
COMPILER_RT_ABI di_int __ashldi3(di_int a, int b);
int test__ashldi3(di_int a, int b, di_int expected)
{
di_int x = __ashldi3(a, b);
if (x != expected)
printf("error in __ashldi3: %llX << %d = %llX, expected %llX\n",
a, b, __ashldi3(a, b), expected);
return x != expected;
}
char assumption_1[sizeof(di_int) == 2*sizeof(si_int)] = {0};
int main()
{
if (test__ashldi3(0x0123456789ABCDEFLL, 0, 0x123456789ABCDEFLL))
return 1;
if (test__ashldi3(0x0123456789ABCDEFLL, 1, 0x2468ACF13579BDELL))
return 1;
if (test__ashldi3(0x0123456789ABCDEFLL, 2, 0x48D159E26AF37BCLL))
return 1;
if (test__ashldi3(0x0123456789ABCDEFLL, 3, 0x91A2B3C4D5E6F78LL))
return 1;
if (test__ashldi3(0x0123456789ABCDEFLL, 4, 0x123456789ABCDEF0LL))
return 1;
if (test__ashldi3(0x0123456789ABCDEFLL, 28, 0x789ABCDEF0000000LL))
return 1;
if (test__ashldi3(0x0123456789ABCDEFLL, 29, 0xF13579BDE0000000LL))
return 1;
if (test__ashldi3(0x0123456789ABCDEFLL, 30, 0xE26AF37BC0000000LL))
return 1;
if (test__ashldi3(0x0123456789ABCDEFLL, 31, 0xC4D5E6F780000000LL))
return 1;
if (test__ashldi3(0x0123456789ABCDEFLL, 32, 0x89ABCDEF00000000LL))
return 1;
if (test__ashldi3(0x0123456789ABCDEFLL, 33, 0x13579BDE00000000LL))
return 1;
if (test__ashldi3(0x0123456789ABCDEFLL, 34, 0x26AF37BC00000000LL))
return 1;
if (test__ashldi3(0x0123456789ABCDEFLL, 35, 0x4D5E6F7800000000LL))
return 1;
if (test__ashldi3(0x0123456789ABCDEFLL, 36, 0x9ABCDEF000000000LL))
return 1;
if (test__ashldi3(0x0123456789ABCDEFLL, 60, 0xF000000000000000LL))
return 1;
if (test__ashldi3(0x0123456789ABCDEFLL, 61, 0xE000000000000000LL))
return 1;
if (test__ashldi3(0x0123456789ABCDEFLL, 62, 0xC000000000000000LL))
return 1;
if (test__ashldi3(0x0123456789ABCDEFLL, 63, 0x8000000000000000LL))
return 1;
return 0;
}