<div dir="ltr">This looks like a good approach. If 0 is a valid instruction on<div>some architecture, we can add a conditional.</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Jul 19, 2018 at 5:55 AM, Sebastian Huber <span dir="ltr"><<a href="mailto:sebastian.huber@embedded-brains.de" target="_blank">sebastian.huber@embedded-brains.de</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On some architectures/simulators it is difficult to provoke an<br>
exception with misaligned or illegal data loads. Use an illegal<br>
instruction instead.<br>
<br>
Update #3433.<br>
---<br>
testsuites/sptests/spfatal26/<wbr>init.c | 10 +++++++++-<br>
1 file changed, 9 insertions(+), 1 deletion(-)<br>
<br>
diff --git a/testsuites/sptests/<wbr>spfatal26/init.c b/testsuites/sptests/<wbr>spfatal26/init.c<br>
index 1848659d6a..7d635f3b84 100644<br>
--- a/testsuites/sptests/<wbr>spfatal26/init.c<br>
+++ b/testsuites/sptests/<wbr>spfatal26/init.c<br>
@@ -1,5 +1,5 @@<br>
/*<br>
- * Copyright (c) 2012 embedded brains GmbH. All rights reserved.<br>
+ * Copyright (c) 2012, 2018 embedded brains GmbH. All rights reserved.<br>
*<br>
* embedded brains GmbH<br>
* Obere Lagerstr. 30<br>
@@ -24,6 +24,13 @@<br>
<br>
const char rtems_test_name[] = "SPFATAL 26";<br>
<br>
+static void provoke_illegal_instruction_<wbr>exception( void )<br>
+{<br>
+#ifdef __riscv<br>
+ __asm__ volatile (".word 0");<br>
+#endif<br>
+}<br>
+<br>
static void provoke_aligment_or_data_<wbr>access_exception( void )<br>
{<br>
uintptr_t one = 1;<br>
@@ -53,6 +60,7 @@ static void Init( rtems_task_argument arg )<br>
{<br>
TEST_BEGIN();<br>
<br>
+ provoke_illegal_instruction_<wbr>exception();<br>
provoke_aligment_or_data_<wbr>access_exception();<br>
<br>
rtems_test_assert( 0 );<br>
<span class="HOEnZb"><font color="#888888">-- <br>
2.13.7<br>
<br>
______________________________<wbr>_________________<br>
devel mailing list<br>
<a href="mailto:devel@rtems.org">devel@rtems.org</a><br>
<a href="http://lists.rtems.org/mailman/listinfo/devel" rel="noreferrer" target="_blank">http://lists.rtems.org/<wbr>mailman/listinfo/devel</a><br>
</font></span></blockquote></div><br></div>