You've already forked linux-packaging-mono
acceptance-tests
data
docs
external
Newtonsoft.Json
api-doc-tools
api-snapshot
aspnetwebstack
bdwgc
binary-reference-assemblies
bockbuild
boringssl
cecil
cecil-legacy
corefx
corert
helix-binaries
ikdasm
ikvm
illinker-test-assets
linker
llvm-project
clang
clang-tools-extra
compiler-rt
cmake
docs
include
lib
test
BlocksRuntime
asan
builtins
TestCases
Unit
arm
ppc
absvdi2_test.c
absvsi2_test.c
absvti2_test.c
adddf3vfp_test.c
addsf3vfp_test.c
addtf3_test.c
addvdi3_test.c
addvsi3_test.c
addvti3_test.c
ashldi3_test.c
ashlti3_test.c
ashrdi3_test.c
ashrti3_test.c
bswapdi2_test.c
bswapsi2_test.c
clear_cache_test.c
clzdi2_test.c
clzsi2_test.c
clzti2_test.c
cmpdi2_test.c
cmpti2_test.c
comparedf2_test.c
comparesf2_test.c
cpu_model_test.c
ctzdi2_test.c
ctzsi2_test.c
ctzti2_test.c
divdc3_test.c
divdf3vfp_test.c
divdi3_test.c
divmodsi4_test.c
divsc3_test.c
divsf3vfp_test.c
divsi3_test.c
divtc3_test.c
divtf3_test.c
divti3_test.c
divxc3_test.c
enable_execute_stack_test.c
endianness.h
eqdf2vfp_test.c
eqsf2vfp_test.c
eqtf2_test.c
extebdsfdf2vfp_test.c
extenddftf2_test.c
extendhfsf2_test.c
extendsftf2_test.c
ffsdi2_test.c
ffssi2_test.c
ffsti2_test.c
fixdfdi_test.c
fixdfsivfp_test.c
fixdfti_test.c
fixsfdi_test.c
fixsfsivfp_test.c
fixsfti_test.c
fixtfdi_test.c
fixtfsi_test.c
fixtfti_test.c
fixunsdfdi_test.c
fixunsdfsi_test.c
fixunsdfsivfp_test.c
fixunsdfti_test.c
fixunssfdi_test.c
fixunssfsi_test.c
fixunssfsivfp_test.c
fixunssfti_test.c
fixunstfdi_test.c
fixunstfsi_test.c
fixunstfti_test.c
fixunsxfdi_test.c
fixunsxfsi_test.c
fixunsxfti_test.c
fixxfdi_test.c
fixxfti_test.c
floatdidf_test.c
floatdisf_test.c
floatditf_test.c
floatdixf_test.c
floatsidfvfp_test.c
floatsisfvfp_test.c
floatsitf_test.c
floattidf_test.c
floattisf_test.c
floattitf_test.c
floattixf_test.c
floatundidf_test.c
floatundisf_test.c
floatunditf_test.c
floatundixf_test.c
floatunsitf_test.c
floatunssidfvfp_test.c
floatunssisfvfp_test.c
floatuntidf_test.c
floatuntisf_test.c
floatuntitf_test.c
floatuntixf_test.c
fp_test.h
gcc_personality_test.c
gcc_personality_test_helper.cxx
gedf2vfp_test.c
gesf2vfp_test.c
getf2_test.c
gtdf2vfp_test.c
gtsf2vfp_test.c
gttf2_test.c
ledf2vfp_test.c
lesf2vfp_test.c
letf2_test.c
lit.cfg
lit.site.cfg.in
lshrdi3_test.c
lshrti3_test.c
ltdf2vfp_test.c
ltsf2vfp_test.c
lttf2_test.c
moddi3_test.c
modsi3_test.c
modti3_test.c
muldc3_test.c
muldf3vfp_test.c
muldi3_test.c
mulodi4_test.c
mulosi4_test.c
muloti4_test.c
mulsc3_test.c
mulsf3vfp_test.c
multc3_test.c
multf3_test.c
multi3_test.c
mulvdi3_test.c
mulvsi3_test.c
mulvti3_test.c
mulxc3_test.c
nedf2vfp_test.c
negdf2vfp_test.c
negdi2_test.c
negsf2vfp_test.c
negti2_test.c
negvdi2_test.c
negvsi2_test.c
negvti2_test.c
nesf2vfp_test.c
netf2_test.c
paritydi2_test.c
paritysi2_test.c
parityti2_test.c
popcountdi2_test.c
popcountsi2_test.c
popcountti2_test.c
powidf2_test.c
powisf2_test.c
powitf2_test.c
powixf2_test.c
subdf3vfp_test.c
subsf3vfp_test.c
subtf3_test.c
subvdi3_test.c
subvsi3_test.c
subvti3_test.c
test
trampoline_setup_test.c
truncdfhf2_test.c
truncdfsf2_test.c
truncdfsf2vfp_test.c
truncsfhf2_test.c
trunctfdf2_test.c
trunctfsf2_test.c
ucmpdi2_test.c
ucmpti2_test.c
udivdi3_test.c
udivmoddi4_test.c.REMOVED.git-id
udivmodsi4_test.c
udivmodti4_test.c.REMOVED.git-id
udivsi3_test.c
udivti3_test.c
umoddi3_test.c
umodsi3_test.c
umodti3_test.c
unorddf2vfp_test.c
unordsf2vfp_test.c
unordtf2_test.c
timing
CMakeLists.txt
lit.cfg
lit.site.cfg.in
cfi
dfsan
esan
fuzzer
hwasan
interception
lsan
msan
profile
safestack
sanitizer_common
scudo
tsan
ubsan
ubsan_minimal
xray
CMakeLists.txt
lit.common.cfg
lit.common.configured.in
unittests
www
.arcconfig
.gitignore
CMakeLists.txt
CODE_OWNERS.TXT
CREDITS.TXT
LICENSE.TXT
README.txt
eng
libcxx
libcxxabi
libunwind
lld
lldb
llvm
nuget
openmp
polly
Directory.Build.props
Directory.Build.targets
NuGet.config
azure-pipelines.yml
build.cmd
build.sh
dir.common.props
global.json
llvm.proj
mxe-Win64.cmake.in
nuget-buildtasks
nunit-lite
roslyn-binaries
rx
xunit-binaries
how-to-bump-roslyn-binaries.md
ikvm-native
llvm
m4
man
mcs
mono
msvc
netcore
po
runtime
samples
scripts
support
tools
COPYING.LIB
LICENSE
Makefile.am
Makefile.in
NEWS
README.md
acinclude.m4
aclocal.m4
autogen.sh
code_of_conduct.md
compile
config.guess
config.h.in
config.rpath
config.sub
configure.REMOVED.git-id
configure.ac.REMOVED.git-id
depcomp
install-sh
ltmain.sh.REMOVED.git-id
missing
mkinstalldirs
mono-uninstalled.pc.in
test-driver
winconfig.h
175 lines
7.5 KiB
C
175 lines
7.5 KiB
C
![]() |
// RUN: %clang_builtins %s %librt -o %t && %run %t
|
||
|
//===-- lshrti3_test.c - Test __lshrti3 -----------------------------------===//
|
||
|
//
|
||
|
// The LLVM Compiler Infrastructure
|
||
|
//
|
||
|
// This file is dual licensed under the MIT and the University of Illinois Open
|
||
|
// Source Licenses. See LICENSE.TXT for details.
|
||
|
//
|
||
|
//===----------------------------------------------------------------------===//
|
||
|
//
|
||
|
// This file tests __lshrti3 for the compiler_rt library.
|
||
|
//
|
||
|
//===----------------------------------------------------------------------===//
|
||
|
|
||
|
#include "int_lib.h"
|
||
|
#include <stdio.h>
|
||
|
|
||
|
#ifdef CRT_HAS_128BIT
|
||
|
|
||
|
// Returns: logical a >> b
|
||
|
|
||
|
// Precondition: 0 <= b < bits_in_dword
|
||
|
|
||
|
COMPILER_RT_ABI ti_int __lshrti3(ti_int a, si_int b);
|
||
|
|
||
|
int test__lshrti3(ti_int a, si_int b, ti_int expected)
|
||
|
{
|
||
|
ti_int x = __lshrti3(a, b);
|
||
|
if (x != expected)
|
||
|
{
|
||
|
twords at;
|
||
|
at.all = a;
|
||
|
twords xt;
|
||
|
xt.all = x;
|
||
|
twords expectedt;
|
||
|
expectedt.all = expected;
|
||
|
printf("error in __lshrti3: 0x%llX%.16llX >> %d = 0x%llX%.16llX,"
|
||
|
" expected 0x%llX%.16llX\n",
|
||
|
at.s.high, at.s.low, b, xt.s.high, xt.s.low,
|
||
|
expectedt.s.high, expectedt.s.low);
|
||
|
}
|
||
|
return x != expected;
|
||
|
}
|
||
|
|
||
|
char assumption_1[sizeof(ti_int) == 2*sizeof(di_int)] = {0};
|
||
|
|
||
|
#endif
|
||
|
|
||
|
int main()
|
||
|
{
|
||
|
#ifdef CRT_HAS_128BIT
|
||
|
if (test__lshrti3(make_ti(0xFEDCBA9876543215LL, 0xFEDCBA9876543215LL), 0,
|
||
|
make_ti(0xFEDCBA9876543215LL, 0xFEDCBA9876543215LL)))
|
||
|
return 1;
|
||
|
if (test__lshrti3(make_ti(0xFEDCBA9876543215LL, 0xFEDCBA9876543215LL), 1,
|
||
|
make_ti(0x7F6E5D4C3B2A190ALL, 0xFF6E5D4C3B2A190ALL)))
|
||
|
return 1;
|
||
|
if (test__lshrti3(make_ti(0xFEDCBA9876543215LL, 0xFEDCBA9876543215LL), 2,
|
||
|
make_ti(0x3FB72EA61D950C85LL, 0x7FB72EA61D950C85LL)))
|
||
|
return 1;
|
||
|
if (test__lshrti3(make_ti(0xFEDCBA9876543215LL, 0xFEDCBA9876543215LL), 3,
|
||
|
make_ti(0x1FDB97530ECA8642LL, 0xBFDB97530ECA8642LL)))
|
||
|
return 1;
|
||
|
if (test__lshrti3(make_ti(0xFEDCBA9876543215LL, 0xFEDCBA9876543215LL), 4,
|
||
|
make_ti(0x0FEDCBA987654321LL, 0x5FEDCBA987654321LL)))
|
||
|
return 1;
|
||
|
|
||
|
if (test__lshrti3(make_ti(0xFEDCBA9876543215LL, 0xFEDCBA9876543215LL), 28,
|
||
|
make_ti(0x0000000FEDCBA987LL, 0x6543215FEDCBA987LL)))
|
||
|
return 1;
|
||
|
if (test__lshrti3(make_ti(0xFEDCBA9876543215LL, 0xFEDCBA9876543215LL), 29,
|
||
|
make_ti(0x00000007F6E5D4C3LL, 0xB2A190AFF6E5D4C3LL)))
|
||
|
return 1;
|
||
|
if (test__lshrti3(make_ti(0xFEDCBA9876543215LL, 0xFEDCBA9876543215LL), 30,
|
||
|
make_ti(0x00000003FB72EA61LL, 0xD950C857FB72EA61LL)))
|
||
|
return 1;
|
||
|
if (test__lshrti3(make_ti(0xFEDCBA9876543215LL, 0xFEDCBA9876543215LL), 31,
|
||
|
make_ti(0x00000001FDB97530LL, 0xECA8642BFDB97530LL)))
|
||
|
return 1;
|
||
|
|
||
|
if (test__lshrti3(make_ti(0xFEDCBA9876543215LL, 0xFEDCBA9876543215LL), 32,
|
||
|
make_ti(0x00000000FEDCBA98LL, 0x76543215FEDCBA98LL)))
|
||
|
return 1;
|
||
|
|
||
|
if (test__lshrti3(make_ti(0xFEDCBA9876543215LL, 0xFEDCBA9876543215LL), 33,
|
||
|
make_ti(0x000000007F6E5D4CLL, 0x3B2A190AFF6E5D4CLL)))
|
||
|
return 1;
|
||
|
if (test__lshrti3(make_ti(0xFEDCBA9876543215LL, 0xFEDCBA9876543215LL), 34,
|
||
|
make_ti(0x000000003FB72EA6LL, 0x1D950C857FB72EA6LL)))
|
||
|
return 1;
|
||
|
if (test__lshrti3(make_ti(0xFEDCBA9876543215LL, 0xFEDCBA9876543215LL), 35,
|
||
|
make_ti(0x000000001FDB9753LL, 0x0ECA8642BFDB9753LL)))
|
||
|
return 1;
|
||
|
if (test__lshrti3(make_ti(0xFEDCBA9876543215LL, 0xFEDCBA9876543215LL), 36,
|
||
|
make_ti(0x000000000FEDCBA9LL, 0x876543215FEDCBA9LL)))
|
||
|
return 1;
|
||
|
|
||
|
if (test__lshrti3(make_ti(0xFEDCBA9876543215LL, 0xFEDCBA9876543215LL), 60,
|
||
|
make_ti(0x000000000000000FLL, 0xEDCBA9876543215FLL)))
|
||
|
return 1;
|
||
|
if (test__lshrti3(make_ti(0xFEDCBA9876543215LL, 0xFEDCBA9876543215LL), 61,
|
||
|
make_ti(0x0000000000000007LL, 0xF6E5D4C3B2A190AFLL)))
|
||
|
return 1;
|
||
|
if (test__lshrti3(make_ti(0xFEDCBA9876543215LL, 0xFEDCBA9876543215LL), 62,
|
||
|
make_ti(0x0000000000000003LL, 0xFB72EA61D950C857LL)))
|
||
|
return 1;
|
||
|
if (test__lshrti3(make_ti(0xFEDCBA9876543215LL, 0xFEDCBA9876543215LL), 63,
|
||
|
make_ti(0x0000000000000001LL, 0xFDB97530ECA8642BLL)))
|
||
|
return 1;
|
||
|
|
||
|
if (test__lshrti3(make_ti(0xFEDCBA9876543215LL, 0xFEDCBA9876543215LL), 64,
|
||
|
make_ti(0x0000000000000000LL, 0xFEDCBA9876543215LL)))
|
||
|
return 1;
|
||
|
|
||
|
if (test__lshrti3(make_ti(0xFEDCBA9876543215LL, 0xFEDCBA9876543215LL), 65,
|
||
|
make_ti(0x0000000000000000LL, 0x7F6E5D4C3B2A190ALL)))
|
||
|
return 1;
|
||
|
if (test__lshrti3(make_ti(0xFEDCBA9876543215LL, 0xFEDCBA9876543215LL), 66,
|
||
|
make_ti(0x0000000000000000LL, 0x3FB72EA61D950C85LL)))
|
||
|
return 1;
|
||
|
if (test__lshrti3(make_ti(0xFEDCBA9876543215LL, 0xFEDCBA9876543215LL), 67,
|
||
|
make_ti(0x0000000000000000LL, 0x1FDB97530ECA8642LL)))
|
||
|
return 1;
|
||
|
if (test__lshrti3(make_ti(0xFEDCBA9876543215LL, 0xFEDCBA9876543215LL), 68,
|
||
|
make_ti(0x0000000000000000LL, 0x0FEDCBA987654321LL)))
|
||
|
return 1;
|
||
|
|
||
|
if (test__lshrti3(make_ti(0xFEDCBA9876543215LL, 0xFEDCBA9876543215LL), 92,
|
||
|
make_ti(0x0000000000000000LL, 0x0000000FEDCBA987LL)))
|
||
|
return 1;
|
||
|
if (test__lshrti3(make_ti(0xFEDCBA9876543215LL, 0xFEDCBA9876543215LL), 93,
|
||
|
make_ti(0x0000000000000000LL, 0x00000007F6E5D4C3LL)))
|
||
|
return 1;
|
||
|
if (test__lshrti3(make_ti(0xFEDCBA9876543215LL, 0xFEDCBA9876543215LL), 94,
|
||
|
make_ti(0x0000000000000000LL, 0x00000003FB72EA61LL)))
|
||
|
return 1;
|
||
|
if (test__lshrti3(make_ti(0xFEDCBA9876543215LL, 0xFEDCBA9876543215LL), 95,
|
||
|
make_ti(0x0000000000000000LL, 0x00000001FDB97530LL)))
|
||
|
return 1;
|
||
|
|
||
|
if (test__lshrti3(make_ti(0xFEDCBA9876543215LL, 0xFEDCBA9876543215LL), 96,
|
||
|
make_ti(0x0000000000000000LL, 0x00000000FEDCBA98LL)))
|
||
|
return 1;
|
||
|
|
||
|
if (test__lshrti3(make_ti(0xFEDCBA9876543215LL, 0xFEDCBA9876543215LL), 97,
|
||
|
make_ti(0x0000000000000000LL, 0x000000007F6E5D4CLL)))
|
||
|
return 1;
|
||
|
if (test__lshrti3(make_ti(0xFEDCBA9876543215LL, 0xFEDCBA9876543215LL), 98,
|
||
|
make_ti(0x0000000000000000LL, 0x000000003FB72EA6LL)))
|
||
|
return 1;
|
||
|
if (test__lshrti3(make_ti(0xFEDCBA9876543215LL, 0xFEDCBA9876543215LL), 99,
|
||
|
make_ti(0x0000000000000000LL, 0x000000001FDB9753LL)))
|
||
|
return 1;
|
||
|
if (test__lshrti3(make_ti(0xFEDCBA9876543215LL, 0xFEDCBA9876543215LL), 100,
|
||
|
make_ti(0x0000000000000000LL, 0x000000000FEDCBA9LL)))
|
||
|
return 1;
|
||
|
|
||
|
if (test__lshrti3(make_ti(0xFEDCBA9876543215LL, 0xFEDCBA9876543215LL), 124,
|
||
|
make_ti(0x0000000000000000LL, 0x000000000000000FLL)))
|
||
|
return 1;
|
||
|
if (test__lshrti3(make_ti(0xFEDCBA9876543215LL, 0xFEDCBA9876543215LL), 125,
|
||
|
make_ti(0x0000000000000000LL, 0x0000000000000007LL)))
|
||
|
return 1;
|
||
|
if (test__lshrti3(make_ti(0xFEDCBA9876543215LL, 0xFEDCBA9876543215LL), 126,
|
||
|
make_ti(0x0000000000000000LL, 0x0000000000000003LL)))
|
||
|
return 1;
|
||
|
if (test__lshrti3(make_ti(0xFEDCBA9876543215LL, 0xFEDCBA9876543215LL), 127,
|
||
|
make_ti(0x0000000000000000LL, 0x0000000000000001LL)))
|
||
|
return 1;
|
||
|
#else
|
||
|
printf("skipped\n");
|
||
|
#endif
|
||
|
return 0;
|
||
|
}
|