public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc(refs/vendors/ARM/heads/morello)] Fix some morello tests for stock AArch64
@ 2022-03-14 10:34 Matthew Malcomson
  0 siblings, 0 replies; only message in thread
From: Matthew Malcomson @ 2022-03-14 10:34 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:1d2295c56d1a0768df17fa2b7ee711551c8dfec4

commit 1d2295c56d1a0768df17fa2b7ee711551c8dfec4
Author: Matthew Malcomson <matthew.malcomson@arm.com>
Date:   Mon Feb 28 17:11:38 2022 +0000

    Fix some morello tests for stock AArch64
    
    known-outside-bounds.c was checking for a warning that we emit when
    writing out a capability that will end up out of bounds.  This warning
    will not occur on fake-capability since it's based on the machinery of
    writing capabilities out.
    
    packed-structures.c was emitting a large amount of warnings on unaligned
    pointers.  We just remove those warnings since the whole point of the
    test was about this precise case.
    
    unwinding.c (and no-frame-chain-unwind.c which used the same code) had
    two compilation problems.  The first was that `uintptr_t` was not
    defined but was used.  Thes econd was that we had an array of function
    pointers which was statically initialised.  For dynamically linked
    programs these function addresses are not known at link time.  Here we
    initialise the function pointers dynamically to account for this.

Diff:
---
 .../aarch64/morello/known-outside-bounds.c         |  2 +-
 .../gcc.target/aarch64/morello/packed-structures.c |  1 +
 .../gcc.target/aarch64/morello/unwinding.c         | 22 +++++++++++-----------
 3 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/gcc/testsuite/gcc.target/aarch64/morello/known-outside-bounds.c b/gcc/testsuite/gcc.target/aarch64/morello/known-outside-bounds.c
index 896861c2fd6..011f3250806 100644
--- a/gcc/testsuite/gcc.target/aarch64/morello/known-outside-bounds.c
+++ b/gcc/testsuite/gcc.target/aarch64/morello/known-outside-bounds.c
@@ -4,5 +4,5 @@ const char *
 foo ()
 {
   return myvar;
-} /* { dg-warning "offset is outside of .* capability from which it is offset" "" { target *-*-* } } */
+} /* { dg-warning "offset is outside of .* capability from which it is offset" "" { target { *-*-* && cheri_capability_pure } } } */
 
diff --git a/gcc/testsuite/gcc.target/aarch64/morello/packed-structures.c b/gcc/testsuite/gcc.target/aarch64/morello/packed-structures.c
index 421eca3c634..d8a1e470f62 100644
--- a/gcc/testsuite/gcc.target/aarch64/morello/packed-structures.c
+++ b/gcc/testsuite/gcc.target/aarch64/morello/packed-structures.c
@@ -1,3 +1,4 @@
+/* { dg-additional-options "-Wno-if-not-aligned" } */
 /*
    This file is for testing the PCS implementation on packed structures.
 
diff --git a/gcc/testsuite/gcc.target/aarch64/morello/unwinding.c b/gcc/testsuite/gcc.target/aarch64/morello/unwinding.c
index ceac96fc7b2..5ab22ea8090 100644
--- a/gcc/testsuite/gcc.target/aarch64/morello/unwinding.c
+++ b/gcc/testsuite/gcc.target/aarch64/morello/unwinding.c
@@ -26,6 +26,7 @@
 #include <stdlib.h>
 #include <assert.h>
 
+typedef __UINTPTR_TYPE__ uintptr_t;
 #define NUM_INTERNAL_CALLS 20
 bool check_performed = false;
 static bool in_func (void *, size_t);
@@ -41,17 +42,7 @@ static int ptr_compare (const void *, const void *);
 static void sort_function_pointers ();
 int main (int, char**);
 
-static uintptr_t function_pointers[] = {
-    &in_func,
-    &trace_function,
-    &unwind_stop,
-    &unwind_cleanup,
-    &test_unwinder,
-    &foo,
-    &ptr_compare,
-    &sort_function_pointers,
-    &main
-};
+static uintptr_t function_pointers[9] = { 0 };
 static int foo_index = -1;
 static int main_index = -1;
 
@@ -277,6 +268,15 @@ static int ptr_compare (const void *a, const void *b)
 
 static void sort_function_pointers ()
 {
+  function_pointers[0] = &in_func;
+  function_pointers[1] = &trace_function;
+  function_pointers[2] = &unwind_stop;
+  function_pointers[3] = &unwind_cleanup;
+  function_pointers[4] = &test_unwinder;
+  function_pointers[5] = &foo;
+  function_pointers[6] = &ptr_compare;
+  function_pointers[7] = &sort_function_pointers;
+  function_pointers[8] = &main;
   size_t num_funcs = sizeof(function_pointers)/sizeof(function_pointers[0]);
   qsort (function_pointers, num_funcs, sizeof(void *), ptr_compare);
   for (size_t i = 0; i < num_funcs; ++i) {


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-03-14 10:34 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-14 10:34 [gcc(refs/vendors/ARM/heads/morello)] Fix some morello tests for stock AArch64 Matthew Malcomson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).