mirror of
https://github.com/biojppm/rapidyaml.git
synced 2026-01-18 13:31:19 +01:00
Fix failing test in armv4/armv5 -O3
This commit is contained in:
41
.github/workflows-in/embedded.ys
vendored
41
.github/workflows-in/embedded.ys
vendored
@@ -1,5 +1,8 @@
|
|||||||
!yamlscript/v0:
|
!yamlscript/v0:
|
||||||
|
|
||||||
|
# DOCKER DEBUGGING EXAMPLES AT THE END!
|
||||||
|
|
||||||
|
|
||||||
:use common: :all
|
:use common: :all
|
||||||
:: workflow-setup()
|
:: workflow-setup()
|
||||||
|
|
||||||
@@ -113,3 +116,41 @@ jobs:
|
|||||||
needs: [canary11, canary20]
|
needs: [canary11, canary20]
|
||||||
:: setup-job('embedded' 'xcompile')
|
:: setup-job('embedded' 'xcompile')
|
||||||
:: define-job(rest(matrix-items) steps20 'c++20')
|
:: define-job(rest(matrix-items) steps20 'c++20')
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# command examples to test in docker
|
||||||
|
#
|
||||||
|
#
|
||||||
|
# apt-get install g{cc,++}-arm-linux-gnueabi
|
||||||
|
# docker exec -it 7e711fd09471 bash -c '( set -xe ; \
|
||||||
|
# arch=armv4 ; flags=" -march=armv4" ; bt=Release ; std=11 ; \
|
||||||
|
# bd=build/docker/$arch-$bt ; \
|
||||||
|
# export C4_EXTERN_DIR=`pwd`/build/extern ; \
|
||||||
|
# function cm() { \
|
||||||
|
# cmake -B $bd -D CMAKE_TOOLCHAIN_FILE=ext/c4core/.github/toolchains/$arch.cmake \
|
||||||
|
# -DCMAKE_BUILD_TYPE=$bt -DC4_CXX_STANDARD=$std -D CXX_STANDARD=$std \
|
||||||
|
# -DCMAKE_CXX_FLAGS=" $flags" -DCMAKE_C_FLAGS=" $flags" \
|
||||||
|
# -DRYML_BUILD_TESTS=ON -D RYML_VALGRIND=OFF ; \
|
||||||
|
# cmake --build $bd -j --target "$@" ; \
|
||||||
|
# } ; \
|
||||||
|
# tgt=ryml-test-parser ; \
|
||||||
|
# exe=./$bd/test/$tgt ; \
|
||||||
|
# cm $tgt ; \
|
||||||
|
# qemu-arm-static -L /usr/arm-linux-gnueabi $exe --gtest_filter="*in_arena_noparser_4*" \
|
||||||
|
# )'
|
||||||
|
#
|
||||||
|
#
|
||||||
|
#
|
||||||
|
# ( set -xe ; \
|
||||||
|
# arch=aaarch64 ; flags="" ; bt=Release ; std=11 ; \
|
||||||
|
# bd=build/docker/$arch-$bt ; \
|
||||||
|
# export C4_EXTERN_DIR=`pwd`/build/extern ; \
|
||||||
|
# function cm() { \
|
||||||
|
# cmake -B $bd -D CMAKE_TOOLCHAIN_FILE=ext/c4core/.github/toolchains/$arch.cmake \
|
||||||
|
# -DCMAKE_BUILD_TYPE=$bt -DC4_CXX_STANDARD=$std -D CXX_STANDARD=$std \
|
||||||
|
# -DCMAKE_CXX_FLAGS="$flags" -DCMAKE_C_FLAGS="$flags" \
|
||||||
|
# -DRYML_BUILD_TESTS=ON -D RYML_VALGRIND=OFF ; \
|
||||||
|
# cmake --build $bd -j --target "$@" ; \
|
||||||
|
# } ; \
|
||||||
|
# cm ryml-test-run )
|
||||||
|
|||||||
@@ -856,10 +856,19 @@ TEST_F(ParseOverloadYamlTest, in_arena_noparser_3_2)
|
|||||||
test_compare(actual, ref);
|
test_compare(actual, ref);
|
||||||
check_tree(actual, actual.arena());
|
check_tree(actual, actual.arena());
|
||||||
}
|
}
|
||||||
|
// workaround for optimizer problem in armv4 and armv5 with -O3: when
|
||||||
|
// the calling the parser overloads that take a NodeRef, the compiler
|
||||||
|
// optimizes the tree away
|
||||||
|
static C4_NO_INLINE void ensure_compiler_knows_tree_was_changed(Tree *t)
|
||||||
|
{
|
||||||
|
C4_DONT_OPTIMIZE(*t);
|
||||||
|
print_tree(*t); // this was also needed (?)
|
||||||
|
}
|
||||||
TEST_F(ParseOverloadYamlTest, in_arena_noparser_4_1)
|
TEST_F(ParseOverloadYamlTest, in_arena_noparser_4_1)
|
||||||
{
|
{
|
||||||
Tree actual;
|
Tree actual;
|
||||||
parse_in_arena(cyaml, actual.rootref());
|
parse_in_arena(cyaml, actual.rootref());
|
||||||
|
ensure_compiler_knows_tree_was_changed(&actual);
|
||||||
test_compare(actual, ref);
|
test_compare(actual, ref);
|
||||||
check_tree(actual, actual.arena());
|
check_tree(actual, actual.arena());
|
||||||
}
|
}
|
||||||
@@ -867,6 +876,7 @@ TEST_F(ParseOverloadYamlTest, in_arena_noparser_4_2)
|
|||||||
{
|
{
|
||||||
Tree actual;
|
Tree actual;
|
||||||
parse_in_arena(filename, cyaml, actual.rootref());
|
parse_in_arena(filename, cyaml, actual.rootref());
|
||||||
|
ensure_compiler_knows_tree_was_changed(&actual);
|
||||||
test_compare(actual, ref);
|
test_compare(actual, ref);
|
||||||
check_tree(actual, actual.arena());
|
check_tree(actual, actual.arena());
|
||||||
}
|
}
|
||||||
@@ -1131,6 +1141,7 @@ TEST_F(ParseOverloadJsonTest, in_arena_noparser_4_1)
|
|||||||
{
|
{
|
||||||
Tree actual;
|
Tree actual;
|
||||||
parse_json_in_arena(cjson, actual.rootref());
|
parse_json_in_arena(cjson, actual.rootref());
|
||||||
|
ensure_compiler_knows_tree_was_changed(&actual);
|
||||||
test_compare(actual, ref);
|
test_compare(actual, ref);
|
||||||
check_tree(actual, actual.arena());
|
check_tree(actual, actual.arena());
|
||||||
}
|
}
|
||||||
@@ -1138,6 +1149,7 @@ TEST_F(ParseOverloadJsonTest, in_arena_noparser_4_2)
|
|||||||
{
|
{
|
||||||
Tree actual;
|
Tree actual;
|
||||||
parse_json_in_arena(filename, cjson, actual.rootref());
|
parse_json_in_arena(filename, cjson, actual.rootref());
|
||||||
|
ensure_compiler_knows_tree_was_changed(&actual);
|
||||||
test_compare(actual, ref);
|
test_compare(actual, ref);
|
||||||
check_tree(actual, actual.arena());
|
check_tree(actual, actual.arena());
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user