From: Alexander Köplinger Date: Sun, 17 Apr 2016 18:06:56 +0000 (+0200) Subject: Merge pull request #2906 from krytarowski/netbsd-support-6 X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=commitdiff_plain;h=438c8f378c1f1000bdc82f0156fa153eaf9138f2;hp=90424b08f61b4e315f88b6d4f0552c57af572b73;p=mono.git Merge pull request #2906 from krytarowski/netbsd-support-6 Welcome to ARM ucontext registers on NetBSD --- diff --git a/configure.ac b/configure.ac index 52bd7759108..862354d02df 100644 --- a/configure.ac +++ b/configure.ac @@ -92,11 +92,11 @@ case "$host" in host_win32=yes mono_cv_clang=no if test "x$cross_compiling" = "xno"; then - if test "x$host" == "x$build" -a "x$host" == "x$target"; then + if test "x$host" = "x$build" -a "x$host" = "x$target"; then target_win32=yes fi else - if test "x$host" == "x$target"; then + if test "x$host" = "x$target"; then target_win32=yes fi fi @@ -2451,7 +2451,7 @@ fi AC_ARG_ENABLE(bcl-opt, [ --disable-bcl-opt BCL is compiled with no optimizations (allows accurate BCL debugging)], test_bcl_opt=$enableval, test_bcl_opt=yes) AC_ARG_ENABLE(perf-events, [ --enable-perf-events Enable using `perf` for profiling on Linux], test_perf_events=$enableval, test_perf_events=no) -if test "x$test_perf_events" == "xyes"; then +if test "x$test_perf_events" = "xyes"; then AC_DEFINE(ENABLE_PERF_EVENTS, 1, [Enable using `perf` for profiling on Linux]) AC_SUBST(ENABLE_PERF_EVENTS) fi @@ -2613,7 +2613,7 @@ if test "x$enable_llvm" = "xyes"; then AC_MSG_CHECKING(LLVM version) AC_MSG_RESULT($llvm_version $llvm_api_version) if echo $llvm_version | grep -q 'mono'; then - if test "x$enable_llvm_version_check" == "xyes"; then + if test "x$enable_llvm_version_check" = "xyes"; then if test "$llvm_version" != "$expected_llvm_version"; then AC_MSG_ERROR([Expected llvm version $expected_llvm_version, but llvm-config --version returned $llvm_version"]) fi @@ -2648,7 +2648,7 @@ if test "x$enable_llvm" = "xyes"; then llvm_jit_libs="" fi LLVM_LIBS=`$LLVM_CONFIG --libs analysis core bitwriter $llvm_jit_libs` - if test "x$LLVM_LIBS" == "x"; then + if test "x$LLVM_LIBS" = "x"; then echo "$LLVM_CONFIG --libs failed." exit 1 fi diff --git a/external/referencesource b/external/referencesource index 836ed963de7..5b907267935 160000 --- a/external/referencesource +++ b/external/referencesource @@ -1 +1 @@ -Subproject commit 836ed963de7fc898e60062175babeca17e67520b +Subproject commit 5b907267935346d2fe110d226bf3a62abcbd0dc6 diff --git a/mcs/class/System/Test/System.Net.WebSockets/ClientWebSocketTest.cs b/mcs/class/System/Test/System.Net.WebSockets/ClientWebSocketTest.cs index 715c748d1f5..0638cb720b3 100644 --- a/mcs/class/System/Test/System.Net.WebSockets/ClientWebSocketTest.cs +++ b/mcs/class/System/Test/System.Net.WebSockets/ClientWebSocketTest.cs @@ -17,7 +17,7 @@ namespace MonoTests.System.Net.WebSockets [TestFixture] public class ClientWebSocketTest { - const string EchoServerUrl = "ws://echo.websocket.org"; + const string EchoServerUrl = "ws://corefx-net.cloudapp.net/WebSocket/EchoWebSocket.ashx"; int Port = NetworkHelpers.FindFreePort (); HttpListener listener; ClientWebSocket socket; diff --git a/mono/metadata/threads.c b/mono/metadata/threads.c index 5b287062804..b8d8ae5de71 100644 --- a/mono/metadata/threads.c +++ b/mono/metadata/threads.c @@ -1634,7 +1634,8 @@ gint32 ves_icall_System_Threading_WaitHandle_WaitAll_internal(MonoArray *mono_ha g_free(handles); - return ret; + /* WAIT_FAILED in waithandle.cs is different from WAIT_FAILED in Win32 API */ + return ret == WAIT_FAILED ? 0x7fffffff : ret; } /* FIXME: exitContext isnt documented */ @@ -1681,7 +1682,8 @@ gint32 ves_icall_System_Threading_WaitHandle_WaitAny_internal(MonoArray *mono_ha return ret - WAIT_ABANDONED_0; } else { - return ret; + /* WAIT_FAILED in waithandle.cs is different from WAIT_FAILED in Win32 API */ + return ret == WAIT_FAILED ? 0x7fffffff : ret; } } @@ -1705,7 +1707,8 @@ gint32 ves_icall_System_Threading_WaitHandle_WaitOne_internal(HANDLE handle, gin mono_thread_clr_state (thread, ThreadState_WaitSleepJoin); - return ret; + /* WAIT_FAILED in waithandle.cs is different from WAIT_FAILED in Win32 API */ + return ret == WAIT_FAILED ? 0x7fffffff : ret; } gint32 @@ -1727,7 +1730,8 @@ ves_icall_System_Threading_WaitHandle_SignalAndWait_Internal (HANDLE toSignal, H mono_thread_clr_state (thread, ThreadState_WaitSleepJoin); - return ret; + /* WAIT_FAILED in waithandle.cs is different from WAIT_FAILED in Win32 API */ + return ret == WAIT_FAILED ? 0x7fffffff : ret; } HANDLE ves_icall_System_Threading_Mutex_CreateMutex_internal (MonoBoolean owned, MonoString *name, MonoBoolean *created) diff --git a/mono/tests/verifier/Makefile b/mono/tests/verifier/Makefile index c170df2714e..b61302fec3a 100644 --- a/mono/tests/verifier/Makefile +++ b/mono/tests/verifier/Makefile @@ -1,19 +1,19 @@ %.exe: %.cil - ilasm2 -out:$@ $< + ilasm -out:$@ $< BatchCompiler.exe: BatchCompiler.cs - gmcs -r:../../../mcs/class/lib/net_2_0/ilasm.exe BatchCompiler.cs + mcs -r:../../../mcs/class/lib/net_4_x/ilasm.exe BatchCompiler.cs test_lib.dll: test_lib.cs - gmcs test_lib.cs -target:library + mcs test_lib.cs -target:library compile-stamp: generate-stamp BatchCompiler.exe test_lib.dll for i in *.cs; do \ EXE="`echo $$i | cut -d. -f1`.exe"; \ DLL="`echo $$i | cut -d. -f1`.dll"; \ if ! [ -f $$EXE ] && ! [ -f $$DLL ]; then \ - gmcs /unsafe $$i; \ + mcs /unsafe $$i; \ fi \ done #MONO_PATH=../../../mcs/class/lib/net_2_0/ mono BatchCompiler.exe @@ -42,7 +42,7 @@ run-test: compile-stamp then \ RES=3; \ fi; \ - if [ "$$FIRST" == "unverifiable" ] || [ "$FIRST" == "typeunverifiable" ]; \ + if [ "$$FIRST" == "unverifiable" ] || [ "$$FIRST" == "typeunverifiable" ]; \ then \ RES=2; \ fi; \ @@ -56,37 +56,37 @@ run-test: compile-stamp fi; \ if [ "$$FIRST" == "strict" ]; \ then \ - #in strict more it must fail under strict check and pass under non-strict check \ + echo "#in strict more it must fail under strict check and pass under non-strict check" >/dev/null; \ ../../metadata/pedump --verify partial-md,error,warn,cls,code $$TEST.exe >/dev/null 2>/dev/null; \ R1=$$?; \ ../../metadata/pedump --verify partial-md,error,warn,cls,code,non-strict $$TEST.exe >/dev/null 2>/dev/null; \ R2=$$?; \ if [ $$R1 != 2 ] && [ $$R1 != 3 ]; then \ echo "$$TEST is strict but did not fail under strict check, got $${R1} but expected 2 or 3"; \ - fi \ - #non-strict result \ + fi; \ + echo "#non-strict result" >/dev/null; \ if [ $$R2 != 0 ]; then \ echo "$$TEST is strict but did not pass under non-strict check, got $${R2} but expected 0"; \ - fi \ + fi; \ elif [ "$$FIRST" == "typeunverifiable" ]; then \ - #in type unverifiable more it must fail under verifiable mode but it's ok under valid mode \ + echo "#in type unverifiable more it must fail under verifiable mode but it's ok under valid mode" >/dev/null; \ ../../metadata/pedump --verify partial-md,error,warn,cls,code $$TEST.exe >/dev/null 2>/dev/null; \ R1=$$?; \ ../../metadata/pedump --verify partial-md,error,warn,cls,code,valid-only $$TEST.exe >/dev/null 2>/dev/null; \ R2=$$?; \ if [ $$R1 != 3 ]; then \ echo "$$TEST is type unverifiable but did not fail under verifiable check, got $${R1} but expected 3"; \ - fi \ - #type unverifiable result \ + fi; \ + echo "#type unverifiable result" >/dev/null; \ if [ $$R2 != 0 ]; then \ echo "$$TEST is type unverifiable but did not pass under non-strict check, got $${R2} but expected 0"; \ - fi \ + fi; \ elif [ $$RES != 99 ]; then \ ../../metadata/pedump --verify partial-md,error,warn,cls,code $$TEST.exe >/dev/null 2>/dev/null; \ R=$$?; \ if [ $$R != $$RES ]; then \ echo "$$TEST failed expected $$RES but got $$R"; \ - fi \ + fi; \ fi; \ done diff --git a/mono/tests/verifier/make_access_test.sh b/mono/tests/verifier/make_access_test.sh index bbbf8302484..72be8020ee5 100755 --- a/mono/tests/verifier/make_access_test.sh +++ b/mono/tests/verifier/make_access_test.sh @@ -13,7 +13,7 @@ TEST_MEMBER_ACCESS=$5 TEST_EXTENDS=$6 TEST_USE_SUB_CLASS=$7 -if [ "$TEST_EXTENDS" == "yes" ]; then +if [ "$TEST_EXTENDS" = "yes" ]; then TEST_EXTENDS="extends Class" TEST_SUPER_TYPE="Class" else @@ -21,7 +21,7 @@ else TEST_SUPER_TYPE="object" fi -if [ "$TEST_USE_SUB_CLASS" == "yes" ]; then +if [ "$TEST_USE_SUB_CLASS" = "yes" ]; then TEST_VAR_TYPE="ExampleClass" else TEST_VAR_TYPE="Class" @@ -87,4 +87,4 @@ $SED -e "s/SUPER_TYPE/${TEST_SUPER_TYPE}/g" -e "s/VALIDITY/${TEST_VALIDITY}/g" - ret } } -//EOF \ No newline at end of file +//EOF diff --git a/mono/tests/verifier/make_bad_op_test.sh b/mono/tests/verifier/make_bad_op_test.sh index 73b79622f5b..4356497ea37 100755 --- a/mono/tests/verifier/make_bad_op_test.sh +++ b/mono/tests/verifier/make_bad_op_test.sh @@ -11,7 +11,7 @@ TEST_BYTE_0=$3 TEST_BYTE_1=$4 -if [ "$TEST_BYTE_1" == "" ] ; then +if [ "x$TEST_BYTE_1" = "x" ] ; then TEST_BYTE_1="0"; fi diff --git a/mono/tests/verifier/make_bin_test.sh b/mono/tests/verifier/make_bin_test.sh index 5ebbbb99416..019b453beb1 100755 --- a/mono/tests/verifier/make_bin_test.sh +++ b/mono/tests/verifier/make_bin_test.sh @@ -12,7 +12,7 @@ TEST_TYPE2=$5 TEST_INIT_EXP=$6 TEST_INIT_VAL=$7 -if [ "$TEST_INIT_VAL" == "yes" ]; then +if [ "$TEST_INIT_VAL" = "yes" ]; then TEST_INIT="$TEST_INIT_EXP\n\t\stloc.1" else TEST_INIT="" @@ -50,4 +50,4 @@ $SED -e "s/INIT/${TEST_INIT}/g" -e "s/VALIDITY/${TEST_VALIDITY}/g" -e "s/TYPE1/$ ldc.i4.0 ret } -//EOF \ No newline at end of file +//EOF diff --git a/mono/tests/verifier/make_boxed_genarg_test.sh b/mono/tests/verifier/make_boxed_genarg_test.sh index 9522718a1c7..32428322b68 100755 --- a/mono/tests/verifier/make_boxed_genarg_test.sh +++ b/mono/tests/verifier/make_boxed_genarg_test.sh @@ -11,7 +11,7 @@ TEST_OP=$3 TEST_BEFORE_OP=$4 TEST_CONSTRAINT_TYPE=$5 -if [ "$TEST_CONSTRAINT_TYPE" == "" ]; then +if [ "x$TEST_CONSTRAINT_TYPE" = "x" ]; then TEST_CONSTRAINT_TYPE="IFace"; fi diff --git a/mono/tests/verifier/make_branch_test.sh b/mono/tests/verifier/make_branch_test.sh index 5ae54d3caff..9ea87a414cf 100755 --- a/mono/tests/verifier/make_branch_test.sh +++ b/mono/tests/verifier/make_branch_test.sh @@ -11,7 +11,7 @@ TEST_POS=$3 TEST_OP=$4 TEST_FIN=$5 -if [ "$TEST_FIN" == "" ]; then +if [ "x$TEST_FIN" = "x" ]; then TEST_FIN="finally"; fi diff --git a/mono/tests/verifier/make_call_test.sh b/mono/tests/verifier/make_call_test.sh index 884333b2acc..08605a0f9cf 100755 --- a/mono/tests/verifier/make_call_test.sh +++ b/mono/tests/verifier/make_call_test.sh @@ -12,7 +12,7 @@ TEST_LOAD_ARGS=$4 TEST_INSTANCE_METHOD=$5 TEST_EXTRA_STUFF=$6 -if [ "$TEST_INSTANCE_METHOD" == "instance" ]; then +if [ "$TEST_INSTANCE_METHOD" = "instance" ]; then MEMBER_TEST_OP=$TEST_OP MEMBER_TEST_LOAD_ARGS=$TEST_LOAD_ARGS MEMBER_TEST_EXTRA_STUFF=$6 diff --git a/mono/tests/verifier/make_cmmp_test.sh b/mono/tests/verifier/make_cmmp_test.sh index 9e8894a709e..2687f0dfe68 100755 --- a/mono/tests/verifier/make_cmmp_test.sh +++ b/mono/tests/verifier/make_cmmp_test.sh @@ -14,7 +14,7 @@ TEST_BEFORE_OP=$6 echo $TEST_OP | grep unbox > /dev/null; -if [ "$?" == "0" ]; then +if [ $? -eq 0 ]; then TEST_CODE=" ldloc.0 box $TEST_TYPE"; diff --git a/mono/tests/verifier/make_cpobj_test.sh b/mono/tests/verifier/make_cpobj_test.sh index 008d485bedf..5110b563ff6 100755 --- a/mono/tests/verifier/make_cpobj_test.sh +++ b/mono/tests/verifier/make_cpobj_test.sh @@ -15,7 +15,7 @@ TEST_EXTRA_OPS=$6 ZZ=`echo $TEST_TYPE1 | grep "\&"` T1_REF=$? -if [ "$T1_REF" == "0" ]; then +if [ $T1_REF -eq 0 ]; then T1_NO_REF=`echo $TEST_TYPE1 | cut -d '\' -f 1` INIT_LOCS=", $T1_NO_REF V_2" INIT_IL="ldloca.s 2\n\tstloc.0" @@ -24,9 +24,9 @@ fi ZZ=`echo $TEST_TYPE2 | grep "\&"` T2_REF=$? -if [ "$T2_REF" == "0" ]; then +if [ $T2_REF -eq 0 ]; then T2_NO_REF=`echo $TEST_TYPE2 | cut -d '\' -f 1` - if [ "$T1_REF" == "0" ]; then + if [ $T1_REF -eq 0 ]; then INIT_LOCS="$INIT_LOCS , $T2_NO_REF V_3" INIT_IL="$INIT_IL \n\tldloca.s 3\n\tstloc.1" else diff --git a/mono/tests/verifier/make_cross_nested_access_test.sh b/mono/tests/verifier/make_cross_nested_access_test.sh index e34c2fbe360..b94b7e960bf 100755 --- a/mono/tests/verifier/make_cross_nested_access_test.sh +++ b/mono/tests/verifier/make_cross_nested_access_test.sh @@ -14,7 +14,7 @@ TEST_EXTENDS=$6 TEST_LOAD_BASE=$7 -if [ "$TEST_EXTENDS" == "yes" ]; then +if [ "$TEST_EXTENDS" = "yes" ]; then TEST_EXTENDS="extends Owner\/Nested" TEST_CONSTRUCTOR="call instance void Owner\/Nested::.ctor()" else @@ -22,7 +22,7 @@ else TEST_CONSTRUCTOR="call instance void object::.ctor()" fi -if [ "$TEST_LOAD_BASE" == "yes" ]; then +if [ "$TEST_LOAD_BASE" = "yes" ]; then TEST_LOAD_REF="ldarg.0" else TEST_LOAD_REF="call class Owner\/Nested Owner::Create ()" diff --git a/mono/tests/verifier/make_ctor_test.sh b/mono/tests/verifier/make_ctor_test.sh index 81febde0c30..6325f616797 100755 --- a/mono/tests/verifier/make_ctor_test.sh +++ b/mono/tests/verifier/make_ctor_test.sh @@ -13,7 +13,7 @@ TEST_TARGET_TYPE=$4 TARGET_TYPE="Test" TEST_OTHER_CODE="call instance void TestClass::'.ctor'()" -if [ "$TEST_TARGET_TYPE" == "other" ]; then +if [ "$TEST_TARGET_TYPE" = "other" ]; then TARGET_TYPE="TestSubClass" TEST_OTHER_CODE=$TEST_CODE TEST_CODE="" diff --git a/mono/tests/verifier/make_delegate_compat_test.sh b/mono/tests/verifier/make_delegate_compat_test.sh index a12b82c373a..31b8581fbe7 100755 --- a/mono/tests/verifier/make_delegate_compat_test.sh +++ b/mono/tests/verifier/make_delegate_compat_test.sh @@ -26,7 +26,7 @@ fi RET_2_LOCAL="$TEST_RET_TYPE2" RET_2_OP="ldloc 0" -if [ "$TEST_RET_TYPE2" == "void" ]; then +if [ "$TEST_RET_TYPE2" = "void" ]; then RET_2_LOCAL="int32" RET_2_OP="nop" fi @@ -47,7 +47,7 @@ MANAGED_METHOD=" } " -if [ "$TEST_USE_NATIVE" == "pinvoke" ]; then +if [ "$TEST_USE_NATIVE" = "pinvoke" ]; then LDFTN="ldftn $TCONV_2 ${TEST_RET_TYPE2} Driver::NativeMethod(${TEST_PARAM_TYPE2})" CALLVIRT="nop" MANAGED_METHOD="" diff --git a/mono/tests/verifier/make_double_nesting_test.sh b/mono/tests/verifier/make_double_nesting_test.sh index 68bc551cf9f..f6271e2fb95 100755 --- a/mono/tests/verifier/make_double_nesting_test.sh +++ b/mono/tests/verifier/make_double_nesting_test.sh @@ -16,7 +16,7 @@ TEST_NESTED_EXTENDS=$8 TEST_LOAD_BASE=$9 -if [ "$TEST_BASE_EXTENDS" == "yes" ]; then +if [ "$TEST_BASE_EXTENDS" = "yes" ]; then TEST_BASE_EXTENDS="extends Root" TEST_BASE_CONSTRUCTOR="call instance void Root::.ctor()" else @@ -24,7 +24,7 @@ else TEST_BASE_CONSTRUCTOR="call instance void object::.ctor()" fi -if [ "$TEST_NESTED_EXTENDS" == "yes" ]; then +if [ "$TEST_NESTED_EXTENDS" = "yes" ]; then TEST_NESTED_EXTENDS="extends Root\/Nested" TEST_NESTED_CONSTRUCTOR="call instance void Root\/Nested::.ctor()" else @@ -32,7 +32,7 @@ else TEST_NESTED_CONSTRUCTOR="call instance void object::.ctor()" fi -if [ "$TEST_LOAD_BASE" == "yes" ]; then +if [ "$TEST_LOAD_BASE" = "yes" ]; then TEST_LOAD_REF="ldarg.0" else TEST_LOAD_REF="call class Root\/Nested Root::Create ()" diff --git a/mono/tests/verifier/make_exception_overlap_test.sh b/mono/tests/verifier/make_exception_overlap_test.sh index 284fadfd7e6..0647eed5b19 100755 --- a/mono/tests/verifier/make_exception_overlap_test.sh +++ b/mono/tests/verifier/make_exception_overlap_test.sh @@ -12,7 +12,7 @@ TEST_BLOCK_2=$4 TEST_WITH_FILTER_BLOCK=$5 TEST_WITH_FINALLY_BLOCK=$6 -if [ "$TEST_WITH_FILTER_BLOCK" == "yes" ]; then +if [ "$TEST_WITH_FILTER_BLOCK" = "yes" ]; then FILTER_BLOCK=" FILTER_BLOCK_3: nop @@ -35,7 +35,7 @@ else FILTER_BLOCK=""; fi -if [ "$TEST_WITH_FINALLY_BLOCK" == "yes" ]; then +if [ "$TEST_WITH_FINALLY_BLOCK" = "yes" ]; then FINALLY_BLOCK=" FINALLY_BLOCK_1: nop diff --git a/mono/tests/verifier/make_field_store_test.sh b/mono/tests/verifier/make_field_store_test.sh index a50a5f4385c..8d72117ffc2 100755 --- a/mono/tests/verifier/make_field_store_test.sh +++ b/mono/tests/verifier/make_field_store_test.sh @@ -11,7 +11,7 @@ TEST_OP=$3 TEST_TYPE1=$4 TEST_TYPE2=$5 TEST_EMIT_CSTOR=$6 -if [ "${TEST_EMIT_CSTOR}" == "yes" ]; then +if [ "${TEST_EMIT_CSTOR}" = "yes" ]; then TEST_CSTOR="newobj instance void ${TEST_TYPE2}::.ctor()"; else TEST_CSTOR="ldloc.0"; diff --git a/mono/tests/verifier/make_initobj_test.sh b/mono/tests/verifier/make_initobj_test.sh index 3382ff99d6e..5b1e064afaa 100755 --- a/mono/tests/verifier/make_initobj_test.sh +++ b/mono/tests/verifier/make_initobj_test.sh @@ -14,7 +14,7 @@ ZZ=`echo $TEST_TYPE1 | grep "\&"` T1_REF=$? LOCAL_INIT=""; -if [ "$T1_REF" == "0" ]; then +if [ $T1_REF -eq 0 ]; then T1_NO_REF=`echo $TEST_TYPE1 | cut -d '\' -f 1` INIT_LOCS=", $T1_NO_REF V_0" INIT_IL="ldloca.s 1\n\tstloc.0" diff --git a/mono/tests/verifier/make_ldobj_test.sh b/mono/tests/verifier/make_ldobj_test.sh index c314cf29702..4a2f84a1ed6 100755 --- a/mono/tests/verifier/make_ldobj_test.sh +++ b/mono/tests/verifier/make_ldobj_test.sh @@ -13,7 +13,7 @@ ZZ=`echo $TEST_TYPE1 | grep "\&"` T1_REF=$? LOCAL_INIT=""; -if [ "$T1_REF" == "0" ]; then +if [ $T1_REF -eq 0 ]; then T1_NO_REF=`echo $TEST_TYPE1 | cut -d '\' -f 1` INIT_LOCS=", $T1_NO_REF V_0" INIT_IL="ldloca.s 1\n\tstloc.0" diff --git a/mono/tests/verifier/make_localloc_test.sh b/mono/tests/verifier/make_localloc_test.sh index 8a5016a7fd1..e53849cf18c 100755 --- a/mono/tests/verifier/make_localloc_test.sh +++ b/mono/tests/verifier/make_localloc_test.sh @@ -16,14 +16,14 @@ TRY_END=" leave END }" -if [ "$TEST_BLOCK" == "catch" ]; then +if [ "$TEST_BLOCK" = "catch" ]; then TRY_MIDDLE=" leave END } catch [mscorlib]System.NullReferenceException {" TRY_END=" leave END }" -elif [ "$TEST_BLOCK" == "filter" ]; then +elif [ "$TEST_BLOCK" = "filter" ]; then TRY_MIDDLE=" leave END } filter {" @@ -34,7 +34,7 @@ elif [ "$TEST_BLOCK" == "filter" ]; then } { leave END }" -elif [ "$TEST_BLOCK" == "handler" ]; then +elif [ "$TEST_BLOCK" = "handler" ]; then TRY_MIDDLE=" leave END } filter { @@ -45,14 +45,14 @@ elif [ "$TEST_BLOCK" == "handler" ]; then TRY_END=" leave END }" -elif [ "$TEST_BLOCK" == "finally" ]; then +elif [ "$TEST_BLOCK" = "finally" ]; then TRY_MIDDLE=" leave END } finally {" TRY_END=" endfinally }" -elif [ "$TEST_BLOCK" == "fault" ]; then +elif [ "$TEST_BLOCK" = "fault" ]; then TRY_MIDDLE=" leave END } fault {" diff --git a/mono/tests/verifier/make_nested_access_test.sh b/mono/tests/verifier/make_nested_access_test.sh index d096e852566..5fd41668a68 100755 --- a/mono/tests/verifier/make_nested_access_test.sh +++ b/mono/tests/verifier/make_nested_access_test.sh @@ -12,7 +12,7 @@ TEST_CLASS_ACCESS=$4 TEST_MEMBER_ACCESS=$5 TEST_EXTENDS=$6 -if [ "$TEST_EXTENDS" == "yes" ]; then +if [ "$TEST_EXTENDS" = "yes" ]; then TEST_EXTENDS="extends Owner" TEST_CONSTRUCTOR="call instance void Owner::.ctor()" else @@ -108,4 +108,4 @@ $SED -e "s/VALIDITY/${TEST_VALIDITY}/g" -e "s/OPCODE/${TEST_OP}/g" -e "s/CONSTRU ldc.i4.0 ret } -//EOF \ No newline at end of file +//EOF diff --git a/mono/tests/verifier/make_obj_store_test.sh b/mono/tests/verifier/make_obj_store_test.sh index f0d53366c87..6390c65695c 100755 --- a/mono/tests/verifier/make_obj_store_test.sh +++ b/mono/tests/verifier/make_obj_store_test.sh @@ -18,7 +18,7 @@ echo $TEST_FILE TEST_TYPE1=`echo $TEST_TYPE1 | $SED -s 's/&/\\\&/'` TEST_TYPE2=`echo $TEST_TYPE2 | $SED -s 's/&/\\\&/'` -if [ "$TEST_CREATE_FIELD" == "no" ]; then +if [ "$TEST_CREATE_FIELD" = "no" ]; then CLASS_FIELDS=""; else CLASS_FIELDS=".field public ${TEST_TYPE1} fld\n .field public static ${TEST_TYPE1} sfld"; diff --git a/mono/tests/verifier/make_overlapped_test.sh b/mono/tests/verifier/make_overlapped_test.sh index baa46d38ae6..239e27dc3b9 100755 --- a/mono/tests/verifier/make_overlapped_test.sh +++ b/mono/tests/verifier/make_overlapped_test.sh @@ -12,7 +12,7 @@ TEST_POS_1=$4 TEST_POS_2=$5 TEST_TYPE_0=$6 -if [ "$TEST_TYPE_0" == "" ] ; then +if [ "x$TEST_TYPE_0" = "x" ] ; then TEST_TYPE_0="int32"; fi diff --git a/mono/tests/verifier/make_stobj_test.sh b/mono/tests/verifier/make_stobj_test.sh index 1bf078b35dd..d1859623b24 100755 --- a/mono/tests/verifier/make_stobj_test.sh +++ b/mono/tests/verifier/make_stobj_test.sh @@ -16,7 +16,7 @@ ZZ=`echo $TEST_TYPE2 | grep "\&"` T2_REF=$? LOCAL_INIT=""; -if [ "$T2_REF" == "0" ]; then +if [ $T2_REF -eq 0 ]; then T2_NO_REF=`echo $TEST_TYPE2 | cut -d '\' -f 1` INIT_LOCS=", $T2_NO_REF V_2" INIT_IL="ldloca.s 2\n\tstloc.1" diff --git a/mono/tests/verifier/make_switch_test.sh b/mono/tests/verifier/make_switch_test.sh index 1767aa48166..face162ef8e 100755 --- a/mono/tests/verifier/make_switch_test.sh +++ b/mono/tests/verifier/make_switch_test.sh @@ -12,7 +12,7 @@ TEST_EXTRA=$4 TEST_OP=$5 TEST_FIN=$6 -if [ "$TEST_FIN" == "" ]; then +if [ "x$TEST_FIN" = "x" ]; then TEST_FIN="finally"; fi diff --git a/mono/tests/verifier/make_tail_call_test.sh b/mono/tests/verifier/make_tail_call_test.sh index de58fa79f35..82bdccdf81d 100755 --- a/mono/tests/verifier/make_tail_call_test.sh +++ b/mono/tests/verifier/make_tail_call_test.sh @@ -12,7 +12,7 @@ TEST_LOAD_OP=$4 TEST_TYPE=$5 TEST_RET_TYPE=$6 -if [ "$TEST_RET_TYPE" == "" ]; then +if [ "x$TEST_RET_TYPE" = "x" ]; then TEST_RET_TYPE="void" else LD_RET_CODE="ldloc.0" diff --git a/mono/tests/verifier/make_tests.sh b/mono/tests/verifier/make_tests.sh index 270c2677b86..25dd54a9257 100755 --- a/mono/tests/verifier/make_tests.sh +++ b/mono/tests/verifier/make_tests.sh @@ -25,7 +25,7 @@ done I=1 for OP in add div mul rem sub do - if [ "$OP" == "div" ] || [ "$OP" == "rem" ]; then + if [ "$OP" = "div" ] || [ "$OP" = "rem" ]; then INIT="yes"; else INIT="no"; @@ -92,7 +92,7 @@ done I=1 for OP in div mul rem do - if [ "$OP" == "div" ] || [ "$OP" == "div" ]; then + if [ "$OP" = "div" ] || [ "$OP" = "div" ]; then INIT="yes"; else INIT="no"; @@ -112,7 +112,7 @@ done I=1 for OP in div mul rem add do - if [ "$OP" == "div" ] || [ "$OP" == "div" ]; then + if [ "$OP" = "div" ] || [ "$OP" = "div" ]; then INIT="yes"; else INIT="no"; @@ -503,9 +503,9 @@ function fix () { A=$1; fi - if [ "$A" == "bool&" ]; then + if [ "$A" = "bool&" ]; then A="int8&"; - elif [ "$A" == "char&" ]; then + elif [ "$A" = "char&" ]; then A="int16&"; fi @@ -522,11 +522,11 @@ do do TA="$(fix $TYPE1)" TB="$(fix $TYPE2)" - if [ "$TA" == "$TB" ]; then + if [ "$TA" = "$TB" ]; then ./make_store_test.sh ref_coercion_${I} valid "$OP" "$TYPE1" "$TYPE2" - elif [ "$TA" == "int32&" ] && [ "$TB" == "int&" ]; then + elif [ "$TA" = "int32&" ] && [ "$TB" = "int&" ]; then ./make_store_test.sh ref_coercion_${I} valid "$OP" "$TYPE1" "$TYPE2" - elif [ "$TA" == "int&" ] && [ "$TB" == "int32&" ]; then + elif [ "$TA" = "int&" ] && [ "$TB" = "int32&" ]; then ./make_store_test.sh ref_coercion_${I} valid "$OP" "$TYPE1" "$TYPE2" else ./make_store_test.sh ref_coercion_${I} unverifiable "$OP" "$TYPE1" "$TYPE2" @@ -545,7 +545,7 @@ do do TA="$(fix $TYPE1)" TB="$(fix $TYPE2)" - if [ "$TA" == "$TB" ]; then + if [ "$TA" = "$TB" ]; then ./make_store_test.sh ref_coercion_${I} valid "$OP" "$TYPE1" "$TYPE2" else ./make_store_test.sh ref_coercion_${I} unverifiable "$OP" "$TYPE1" "$TYPE2" @@ -561,7 +561,7 @@ do do for TYPE2 in 'class ClassA&' 'class ClassB&' 'class InterfaceA&' 'class InterfaceB&' 'class ValueType&' do - if [ "$TYPE1" == "$TYPE2" ]; then + if [ "$TYPE1" = "$TYPE2" ]; then ./make_store_test.sh ref_coercion_${I} valid "$OP" "$TYPE1" "$TYPE2" else ./make_store_test.sh ref_coercion_${I} unverifiable "$OP" "$TYPE1" "$TYPE2" @@ -791,17 +791,17 @@ do ZZ=`echo $TYPE2 | grep "*";` T2_PTR=$? - if (($T1_PTR == 0 || $T2_PTR == 0)); then + if [ $T1_PTR -eq 0 ] || [ $T2_PTR -eq 0 ]; then ./make_stack_merge_test.sh stack_merge_${I} unverifiable "$TYPE1" "$TYPE2" - elif [ "$TYPE1" == "$TYPE2" ]; then + elif [ "$TYPE1" = "$TYPE2" ]; then ./make_stack_merge_test.sh stack_merge_${I} valid "$TYPE1" "$TYPE2" - elif [ "$TYPE1" == "int32" ] && [ "$TYPE2" == "native int" ]; then + elif [ "$TYPE1" = "int32" ] && [ "$TYPE2" = "native int" ]; then ./make_stack_merge_test.sh stack_merge_${I} valid "$TYPE1" "$TYPE2" - elif [ "$TYPE1" == "native int" ] && [ "$TYPE2" == "int32" ]; then + elif [ "$TYPE1" = "native int" ] && [ "$TYPE2" = "int32" ]; then ./make_stack_merge_test.sh stack_merge_${I} valid "$TYPE1" "$TYPE2" - elif [ "$TYPE1" == "int32&" ] && [ "$TYPE2" == "native int&" ]; then + elif [ "$TYPE1" = "int32&" ] && [ "$TYPE2" = "native int&" ]; then ./make_stack_merge_test.sh stack_merge_${I} valid "$TYPE1" "$TYPE2" - elif [ "$TYPE1" == "native int&" ] && [ "$TYPE2" == "int32&" ]; then + elif [ "$TYPE1" = "native int&" ] && [ "$TYPE2" = "int32&" ]; then ./make_stack_merge_test.sh stack_merge_${I} valid "$TYPE1" "$TYPE2" else ./make_stack_merge_test.sh stack_merge_${I} unverifiable "$TYPE1" "$TYPE2" @@ -1335,7 +1335,7 @@ do MAX_PARAM_RESULT="unverifiable" POPS="pop\npop\npop\npop\npop\npop\npop\npop\n" - if [ "$OP" == "ldloc" ]; then + if [ "$OP" = "ldloc" ]; then MAX_PARAM_RESULT="invalid" LOCALS_1=$ARGS_1 @@ -1892,7 +1892,7 @@ function create_nesting_test_same_result () { do for LOAD in yes no do - if ! ( [ "$NESTED" == "no" ] && [ "$LOAD" == "yes" ] ) ; then + if ! ( [ "$NESTED" = "no" ] && [ "$LOAD" = "yes" ] ) ; then ./make_double_nesting_test.sh double_nesting_access_check_${K}_$I $2 "$OP" $3 $4 $5 "$BASE" "$NESTED" "$LOAD" K=`expr $K + 1` fi @@ -1910,9 +1910,9 @@ function create_nesting_test_only_first_ok () { do for LOAD in yes no do - if ! ( [ "$NESTED" == "no" ] && [ "$LOAD" == "yes" ] ) ; then + if ! ( [ "$NESTED" = "no" ] && [ "$LOAD" = "yes" ] ) ; then EXPECT=unverifiable - if [ "$FIRST" == "$K" ]; then + if [ "$FIRST" = "$K" ]; then EXPECT=valid fi ./make_double_nesting_test.sh double_nesting_access_check_${K}_$I $EXPECT "$OP" $2 $3 $4 "$BASE" "$NESTED" "$LOAD" @@ -2065,7 +2065,7 @@ function create_nesting_test_strips_result_static () { for NESTED in yes no do EXPECT=unverifiable - if [ "$NESTED" == "yes" ]; then + if [ "$NESTED" = "yes" ]; then EXPECT=valid fi ./make_double_nesting_test.sh double_nesting_access_check_${K}_$I $EXPECT "$OP" $2 $3 $4 "$BASE" "$NESTED" yes @@ -2188,9 +2188,9 @@ function fix_ldobj () { A=$1; fi - if [ "$A" == "bool" ]; then + if [ "$A" = "bool" ]; then A="int8"; - elif [ "$A" == "char" ]; then + elif [ "$A" = "char" ]; then A="int16"; fi @@ -2207,7 +2207,7 @@ do do TYPE1="$(fix_ldobj $T1)" TYPE2="$(fix_ldobj $T2)" - if [ "$TYPE1" == "$TYPE2" ] ; then + if [ "$TYPE1" = "$TYPE2" ] ; then ./make_ldobj_test.sh ldobj_${I} valid "${T1}\&" "${T2}" else ./make_ldobj_test.sh ldobj_${I} unverifiable "${T1}\&" "${T2}" @@ -2564,7 +2564,7 @@ I=1 for TYPE1 in "int8" "bool" "int16" "char" "int32" "int64" "float64" "native int" "object" "string" "class Class" "valuetype MyStruct" "int32[]" "int32[,]" "int32*" "method int32 *(int32)" "class Template\`1" do ./make_store_indirect_test.sh indirect_store_bad_addr_r4_${I} unverifiable "stind.r4" "${TYPE1}\&" "float32" - if [ "$TYPE1" == "float64" ]; then + if [ "$TYPE1" = "float64" ]; then ./make_store_indirect_test.sh indirect_store_good_val_r4_${I} valid "stind.r4" "float32\&" "${TYPE1}" else ./make_store_indirect_test.sh indirect_store_bad_val_r4_${I} unverifiable "stind.r4" "float32\&" "${TYPE1}" @@ -2577,7 +2577,7 @@ I=1 for TYPE1 in "int8" "bool" "int16" "char" "int32" "int64" "float32" "native int" "object" "string" "class Class" "valuetype MyStruct" "int32[]" "int32[,]" "int32*" "method int32 *(int32)" "class Template\`1" do ./make_store_indirect_test.sh indirect_store_bad_addr_r8_${I} unverifiable "stind.r8" "${TYPE1}\&" "float64" - if [ "$TYPE1" == "float32" ]; then + if [ "$TYPE1" = "float32" ]; then ./make_store_indirect_test.sh indirect_store_good_val_r8_${I} valid "stind.r8" "float64\&" "${TYPE1}"; else ./make_store_indirect_test.sh indirect_store_bad_val_r8_${I} unverifiable "stind.r8" "float64\&" "${TYPE1}"; @@ -3223,30 +3223,34 @@ done # Exception block branch tests (see 2.19) -for I in {1..2}; +I=1; while [ $I -le 2 ] do ./make_rethrow_test.sh rethrow_from_catch_${I} invalid ${I} + I=$((I + 1)) done -for I in {3..10}; +I=3; while [ $I -le 10 ] do ./make_rethrow_test.sh rethrow_from_catch_${I} valid ${I} + I=$((I + 1)) done # endfinally / endfault -for I in {1..7}; +I=1; while [ $I -le 7 ] do ./make_endfinally_test.sh endfinally_block_${I} invalid finally ${I} ./make_endfinally_test.sh endfault_block_${I} invalid fault ${I} + I=$((I + 1)) done -for I in {8..9}; +I=8; while [ $I -le 9 ] do ./make_endfinally_test.sh endfinally_block_${I} valid finally ${I} ./make_endfinally_test.sh endfault_block_${I} valid fault ${I} + I=$((I + 1)) done #stack can have stuff and endfinally or endfault will just empty it @@ -3268,7 +3272,7 @@ done ./make_endfilter_test.sh endfilter_inside_protected_block_3 invalid 3 "ldc.i4.1\n\t\tendfilter" ./make_endfilter_test.sh endfilter_inside_protected_block_5 strict 5 "ldc.i4.1\n\t\tendfilter" -for I in {2,4,6}; +for I in 2 4 6; do ./make_endfilter_test.sh endfilter_inside_protected_block_${I} unverifiable ${I} "ldc.i4.1\n\t\tendfilter" done @@ -3302,9 +3306,9 @@ EXTRA="ldloc.0\n\tbrfalse END" ./make_leave_test.sh "filter_block_test_1" valid "1" "leave END" "$EXTRA" #but not ok to leave finally or filter -for I in {2..3}; -do +I=2; while [ $I -le 3 ]; do ./make_leave_test.sh "filter_block_test_${I}" unverifiable "${I}" "leave END" "${EXTRA}_${I}" + I=$((I + 1)) done #neither is to branch to invalid regions of code @@ -3314,24 +3318,27 @@ done # br.X #valid tests -for I in {1..6}; do +I=1; while [ $I -le 6 ]; do ./make_branch_test.sh branch_inside_same_block_${I} valid ${I} "br BLOCK_${I}"; ./make_branch_test.sh branch_inside_same_block_${I}_s valid ${I} "br.s BLOCK_${I}"; + I=$((I + 1)) done #branching outside of the protected block -for I in {2..6}; do +I=2; while [ $I -le 6 ]; do ./make_branch_test.sh branch_outside_protected_block_${I} unverifiable ${I} "br END"; + I=$((I + 1)) done #branching to a protected block from the outside -for I in {2..6}; do - if [ "$I" == "4" ]; then +I=2; while [ $I -le 6 ]; do + if [ $I -eq 4 ]; then ./make_branch_test.sh branch_inside_protected_block_from_outside_${I}_finally invalid 1 "br BLOCK_${I}" "finally"; ./make_branch_test.sh branch_inside_protected_block_from_outside_${I}_fault invalid 1 "br BLOCK_${I}" "fault"; else ./make_branch_test.sh branch_inside_protected_block_from_outside_${I} unverifiable 1 "br BLOCK_${I}"; fi + I=$((I + 1)) done @@ -3349,25 +3356,28 @@ done #TODO test the encoding of the switch table # switch #valid tests -for I in {1..6}; do +I=1; while [ $I -le 6 ]; do ./make_switch_test.sh switch_inside_same_block_${I} valid ${I} "ldloc.0" "switch (BLOCK_${I}, BLOCK_${I}_B)"; + I=$((I + 1)) done ./make_switch_test.sh switch_with_native_int_on_stack valid 1 "ldloc.1" "switch (BLOCK_1, BLOCK_1_B)"; #branching outside of the protected block -for I in {2..6}; do +I=2; while [ $I -le 6 ]; do ./make_switch_test.sh switch_outside_protected_block_${I} unverifiable ${I} "ldloc.0" "switch (END, BLOCK_1, BLOCK_1_B)"; + I=$((I + 1)) done #branching to a protected block from the outside -for I in {2..6}; do - if [ "$I" == "4" ]; then +I=2; while [ $I -le 6 ]; do + if [ $I -eq 4 ]; then ./make_switch_test.sh switch_inside_protected_block_from_outside_${I}_finally invalid 1 "ldloc.0" "switch (BLOCK_${I}, BLOCK_${I}_B)" "finally"; ./make_switch_test.sh switch_inside_protected_block_from_outside_${I}_fault invalid 1 "ldloc.0" "switch (BLOCK_${I}, BLOCK_${I}_B)" "fault"; else ./make_switch_test.sh switch_inside_protected_block_from_outside_${I} unverifiable 1 "ldloc.0" "switch (BLOCK_${I}, BLOCK_${I}_B)"; fi + I=$((I + 1)) done #TODO branching out of range (FIX ilasm first) @@ -4893,33 +4903,38 @@ done ./make_overlapped_test.sh ref_only_overlapping_5 invalid 0 0 8 int32 #invalid opcodes -for I in {166..178} +I=166; while [ $I -le 178 ] do ./make_bad_op_test.sh bad_op_$I invalid $I + I=$((I + 1)) done -for I in {187..193} +I=187; while [ $I -le 193 ] do ./make_bad_op_test.sh bad_op_$I invalid $I + I=$((I + 1)) done -for I in {196..207} +I=196; while [ $I -le 207 ] do ./make_bad_op_test.sh bad_op_$I invalid $I + I=$((I + 1)) done -for I in {225..253} +I=225; while [ $I -le 253 ] do ./make_bad_op_test.sh bad_op_$I invalid $I + I=$((I + 1)) done ./make_bad_op_test.sh bad_op_xff invalid 255 -for I in {35..255} +I=35; while [ $I -le 255 ] do ./make_bad_op_test.sh bad_op_with_prefix_$I invalid 0xFE $I + I=$((I + 1)) done @@ -5148,5 +5163,3 @@ done ./make_generic_argument_constraints_test.sh type_mixed_3 valid "" "(IfaceA)" ./make_generic_argument_constraints_test.sh type_mixed_4 valid "" "class (IfaceA)" - - diff --git a/mono/utils/mono-proclib.c b/mono/utils/mono-proclib.c index 479655189b5..7a4a02e39a3 100644 --- a/mono/utils/mono-proclib.c +++ b/mono/utils/mono-proclib.c @@ -27,6 +27,7 @@ #if defined(_POSIX_VERSION) #include #include +#include #ifdef HAVE_SYS_TYPES_H #include #endif diff --git a/mono/utils/mono-sigcontext.h b/mono/utils/mono-sigcontext.h index 36f2a69805f..3c2f79b58c3 100644 --- a/mono/utils/mono-sigcontext.h +++ b/mono/utils/mono-sigcontext.h @@ -201,6 +201,10 @@ typedef struct ucontext { #define UCONTEXT_REG_RSI(ctx) (((ucontext_t*)(ctx))->uc_mcontext.__gregs [_REG_RSI]) #define UCONTEXT_REG_RDI(ctx) (((ucontext_t*)(ctx))->uc_mcontext.__gregs [_REG_RDI]) #define UCONTEXT_REG_RIP(ctx) (((ucontext_t*)(ctx))->uc_mcontext.__gregs [_REG_RIP]) + #define UCONTEXT_REG_R8(ctx) (((ucontext_t*)(ctx))->uc_mcontext.__gregs [_REG_R8]) + #define UCONTEXT_REG_R9(ctx) (((ucontext_t*)(ctx))->uc_mcontext.__gregs [_REG_R9]) + #define UCONTEXT_REG_R10(ctx) (((ucontext_t*)(ctx))->uc_mcontext.__gregs [_REG_R10]) + #define UCONTEXT_REG_R11(ctx) (((ucontext_t*)(ctx))->uc_mcontext.__gregs [_REG_R11]) #define UCONTEXT_REG_R12(ctx) (((ucontext_t*)(ctx))->uc_mcontext.__gregs [_REG_R12]) #define UCONTEXT_REG_R13(ctx) (((ucontext_t*)(ctx))->uc_mcontext.__gregs [_REG_R13]) #define UCONTEXT_REG_R14(ctx) (((ucontext_t*)(ctx))->uc_mcontext.__gregs [_REG_R14]) diff --git a/scripts/ci/run-jenkins.sh b/scripts/ci/run-jenkins.sh index 7e999c540bf..81945bfc56e 100755 --- a/scripts/ci/run-jenkins.sh +++ b/scripts/ci/run-jenkins.sh @@ -15,6 +15,12 @@ if [[ ${label} != w* ]] && [[ ${label} != 'debian-ppc64el' ]] && [[ ${label} != # only enable the mobile profiles and mobile_static on the main architectures fi +if [ -x "/usr/bin/dpkg-architecture" ]; + then + EXTRA_CONF_FLAGS="$EXTRA_CONF_FLAGS --host=`/usr/bin/dpkg-architecture -qDEB_HOST_GNU_TYPE`" + #force build arch = dpkg arch, sometimes misdetected +fi + ${TESTCMD} --label=configure --timeout=60m --fatal ./autogen.sh $EXTRA_CONF_FLAGS if [[ ${label} == w* ]]; then