Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/main'
Browse files Browse the repository at this point in the history
  • Loading branch information
mysterymath committed Jun 25, 2024
2 parents 34c2ffa + 14af6cc commit cc3e672
Show file tree
Hide file tree
Showing 8 changed files with 59 additions and 34 deletions.
4 changes: 3 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,9 @@ mark_as_advanced(TEST_SUITE_REMOTE_CLIENT)
if(TEST_SUITE_REMOTE_HOST)
add_custom_target(rsync
COMMAND ${PROJECT_SOURCE_DIR}/utils/rsync.sh
${TEST_SUITE_REMOTE_HOST} ${PROJECT_BINARY_DIR}
${TEST_SUITE_REMOTE_CLIENT}
${TEST_SUITE_REMOTE_HOST}
${PROJECT_BINARY_DIR}
USES_TERMINAL
)
endif()
Expand Down
1 change: 1 addition & 0 deletions Fortran/UnitTests/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# This file should only contain add_subdirectory(...) one for each test
add_subdirectory(hello)
add_subdirectory(assign-goto)
add_subdirectory(fcvs21_f95) # NIST Fortran Compiler Validation Suite
add_subdirectory(finalization)
3 changes: 3 additions & 0 deletions Fortran/UnitTests/assign-goto/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
llvm_singlesource()

file(COPY lit.local.cfg DESTINATION "${CMAKE_CURRENT_BINARY_DIR}")
11 changes: 11 additions & 0 deletions Fortran/UnitTests/assign-goto/assign-goto.f90
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
subroutine s(x)
integer :: x
assign 222 to x
goto x
222 continue
end subroutine s

program test
integer :: a
call s(a)
end program test
2 changes: 2 additions & 0 deletions Fortran/UnitTests/assign-goto/lit.local.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
config.traditional_output = True
config.single_source = True
4 changes: 4 additions & 0 deletions Fortran/gfortran/regression/DisabledFiles.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -1534,6 +1534,10 @@ file(GLOB FAILING_FILES CONFIGURE_DEPENDS
directive_unroll_5.f90
# Tests "!GCC$ attributes weak :: x"
weak-3.f90
# Test is not conformant as it writes to a constant argument
# Similar test, that is conformant, added to UnitTests/assign-goto
assign_5.f90


# Probable bugs
# ["a", "ab"]
Expand Down
60 changes: 30 additions & 30 deletions SingleSource/UnitTests/AArch64/acle-fmv-features.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ static bool safe_try_feature(bool (*try_feature)(void));
static bool any_fails = false;

#if __HAVE_FUNCTION_MULTI_VERSIONING
#define CHECK(X, BODY) \
__attribute__((target(#X))) \
#define CHECK(X, TARGET_GUARD, BODY) \
__attribute__((target(#TARGET_GUARD))) \
static bool try_##X(void) { \
do \
BODY \
Expand All @@ -42,90 +42,90 @@ static bool any_fails = false;
} \
}
#else
#define CHECK(X, BODY) \
#define CHECK(X, TARGET_GUARD, BODY) \
static void check_##X(void) { \
printf("%s\n", #X); \
}
#endif

CHECK(flagm, {
CHECK(flagm, flagm, {
asm volatile (
"cfinv" "\n"
"cfinv" "\n"
);
})
CHECK(flagm2, {
CHECK(flagm2, arch=armv8.5-a, {
asm volatile (
"axflag" "\n"
"xaflag" "\n"
);
})
CHECK(dotprod, {
CHECK(dotprod, dotprod, {
asm volatile (
"udot v0.4S,v1.16B,v2.16B"
: : : "v0"
);
})
CHECK(sha3, {
CHECK(sha3, sha3, {
asm volatile (
"fmov d0, #0" "\n"
"fmov d1, #0" "\n"
"eor3 v0.16b, v0.16b, v0.16b, v0.16b" "\n"
: : : "v0"
);
})
CHECK(rdm, {
CHECK(rdm, rdm, {
asm volatile (
"sqrdmlah s0, s1, s2"
: : : "s0"
);
})
CHECK(lse, {
CHECK(lse, lse, {
uint64_t pointee = 0;
asm volatile (
"swp xzr, xzr, [%[pointee]]"
: : [pointee]"r"(&pointee)
);
})
CHECK(sha2, {
CHECK(sha2, sha2, {
asm volatile (
"fmov d0, #0" "\n"
"fmov d1, #0" "\n"
"sha256h q0, q0, v0.4s" "\n"
: : : "v0"
);
})
CHECK(sha1, {
CHECK(sha1, sha1, {
asm volatile (
"fmov s0, #0" "\n"
// FIXME: sha1h is under +sha2 in clang, and +sha1 doesn't exist yet.
".inst 0x5e280800" "\n" // sha1h s0, s0
: : : "v0"
);
})
CHECK(aes, {
CHECK(aes, aes, {
asm volatile (
"fmov d0, #0" "\n"
"fmov d1, #0" "\n"
"aesd v0.16B, v0.16B" "\n"
: : : "v0"
);
})
CHECK(pmull, {
CHECK(pmull, aes, {
asm volatile (
"fmov d0, #0" "\n"
"pmull v0.1q, v0.1d, v0.1d" "\n"
: : : "v0"
);
})
CHECK(rcpc, {
CHECK(rcpc, rcpc, {
int x;
asm volatile (
"ldaprb w0, [%0]"
: : "r" (&x) : "w0"
);
})
CHECK(rcpc2, {
CHECK(rcpc2, rcpc2, {
int x;
asm volatile (
"mov x1, %0" "\n"
Expand All @@ -134,66 +134,66 @@ CHECK(rcpc2, {
: : "r" (&x) : "w0"
);
})
CHECK(fcma, {
CHECK(fcma, fcma, {
asm volatile (
"fmov d0, #0" "\n"
"fcadd v0.2s, v0.2s, v0.2s, #90" "\n"
: : : "v0"
);
})
CHECK(jscvt, {
CHECK(jscvt, jscvt, {
asm volatile (
"fmov d0, #0" "\n"
"fjcvtzs w1, d0" "\n"
: : : "w1", "d0"
);
})
CHECK(dpb, {
CHECK(dpb, arch=armv8.2-a, {
int x;
asm volatile (
"dc cvap, %0"
: : "r" (&x)
);
})
CHECK(dpb2, {
CHECK(dpb2, arch=armv8.5-a, {
int x;
asm volatile (
"dc cvadp, %0"
: : "r" (&x)
);
})
CHECK(bf16, {
CHECK(bf16, bf16, {
asm volatile (
"bfdot v0.4S,v1.8H,v2.8H"
: : : "v0"
);
})
CHECK(i8mm, {
CHECK(i8mm, i8mm, {
asm volatile (
"sudot v0.4S,v1.16B,v2.4B[0]"
: : : "v0"
);
})
CHECK(dit, {
CHECK(dit, dit, {
asm volatile (
"msr DIT, x0"
: : : "x0"
);
})
CHECK(fp16, {
CHECK(fp16, fp16, {
asm volatile (
"fmov h0, #0"
: : : "v0"
);
})
CHECK(ssbs2, {
CHECK(ssbs2, ssbs, {
asm volatile (
"mrs x0, SSBS" "\n"
"msr SSBS, x0" "\n"
: : : "x0"
);
})
CHECK(bti, {
CHECK(bti, bti, {
// The only test for this requires reading a register that is only
// accessible to EL1.
#ifdef __linux__
Expand All @@ -214,28 +214,28 @@ CHECK(bti, {
// TODO: implement me on your platform to fix this test!
#endif
})
CHECK(simd, {
CHECK(simd, simd, {
asm volatile (
"mov v0.B[0], w0"
: : :
);
})
CHECK(fp, {
CHECK(fp, fp, {
asm volatile (
"fmov s0, #0"
: : : "v0"
);
})
CHECK(crc, {
CHECK(crc, crc, {
asm volatile ( "crc32b wzr, wzr, wzr");
})
CHECK(sme, {
CHECK(sme, sme, {
asm volatile (
"rdsvl x0, #1"
: : : "x0"
);
})
CHECK(sme2, {
CHECK(sme2, sme2, {
asm volatile (
"smstart za" "\n"
"zero { zt0 }" "\n"
Expand Down
8 changes: 5 additions & 3 deletions utils/rsync.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
#!/bin/bash
# Sync a build directory to remote device for running.
set -eu
DEVICE="$1"
BUILDDIR="$2"
CLIENT="$1"
DEVICE="$2"
BUILDDIR="$3"

case $BUILDDIR in
/*) ;;
Expand All @@ -15,6 +16,7 @@ esac
RSYNC_FLAGS=""
RSYNC_FLAGS+=" -a"
RSYNC_FLAGS+=" --delete --delete-excluded"
RSYNC_FLAGS+=" -e \"$CLIENT\""
# We cannot easily differentiate between intermediate build results and
# files necessary to run the benchmark, so for now we just exclude based on
# some file extensions...
Expand All @@ -30,5 +32,5 @@ RSYNC_FLAGS+=" --exclude=rules.ninja"
RSYNC_FLAGS+=" --exclude=CMakeFiles/"

set -x
ssh $DEVICE mkdir -p "$BUILDDIR"
$CLIENT $DEVICE mkdir -p "$BUILDDIR"
eval rsync $RSYNC_FLAGS $BUILDDIR/ $DEVICE:$BUILDDIR/

0 comments on commit cc3e672

Please sign in to comment.