From: David Edelsohn Date: Sun, 15 Nov 2020 02:10:25 +0000 (-0500) Subject: testsuite: Update scanning symbol sections to support AIX. X-Git-Tag: basepoints/gcc-12~3216 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6403e02510fe84c72c515247a9dfdb6e05d977fe;p=thirdparty%2Fgcc.git testsuite: Update scanning symbol sections to support AIX. gcc/testsuite: * lib/scanasm.exp (parse_section_of_symbols): Also look for AIX XCOFF CSECT notation. * g++.dg/opt/const4.C: Also look for AIX XCOFF "[RO]". * gcc.dg/20021029-1.c: Likewise. * gcc.dg/array-quals-1.c: Likewise and "[RW]". * g++.dg/gomp/tls-5.C: Also look for AIX XCOFF "[TL]". * gcc.dg/pr25376.c: Accept AIX decoration around named section and function descriptor. --- diff --git a/gcc/testsuite/g++.dg/gomp/tls-5.C b/gcc/testsuite/g++.dg/gomp/tls-5.C index a1d3120fbfb1..b18a1277edcb 100644 --- a/gcc/testsuite/g++.dg/gomp/tls-5.C +++ b/gcc/testsuite/g++.dg/gomp/tls-5.C @@ -1,8 +1,8 @@ // The reference temp should be TLS, not normal data. // { dg-require-effective-target c++11 } // { dg-final { scan-assembler-not "\\.data" { target tls_native xfail powerpc-*-aix* } } } -// { dg-final { scan-assembler-symbol-section {^_?ir$} {^\.tbss} } } -// { dg-final { scan-assembler-symbol-section {^_?_ZGR2ir_$} {^\.tdata} } } +// { dg-final { scan-assembler-symbol-section {^_?ir$} {^\.tbss|\[TL\]} } } +// { dg-final { scan-assembler-symbol-section {^_?_ZGR2ir_$} {^\.tdata|\[TL\]} } } extern int&& ir; #pragma omp threadprivate (ir) diff --git a/gcc/testsuite/g++.dg/opt/const4.C b/gcc/testsuite/g++.dg/opt/const4.C index 51d5313a312b..75ee0e6ba845 100644 --- a/gcc/testsuite/g++.dg/opt/const4.C +++ b/gcc/testsuite/g++.dg/opt/const4.C @@ -3,7 +3,7 @@ // that have it. // { dg-do compile } -// { dg-final { scan-assembler-symbol-section {constant_variable} {^\.(const|rodata)} } } +// { dg-final { scan-assembler-symbol-section {constant_variable} {^\.(const|rodata)|\[RO\]} } } const int constant_variable[] __attribute__ ((__used__)) = { 0, 1, 2, 3 }; // The MMIX port always switches to the .data section at the end of a file. diff --git a/gcc/testsuite/gcc.dg/20021029-1.c b/gcc/testsuite/gcc.dg/20021029-1.c index c8ae4aa60e2a..57c2b48f13c4 100644 --- a/gcc/testsuite/gcc.dg/20021029-1.c +++ b/gcc/testsuite/gcc.dg/20021029-1.c @@ -3,7 +3,7 @@ /* { dg-do compile { target fpic } } */ /* { dg-options "-O2 -fpic" } */ /* { dg-final { scan-assembler-not ".data.rel.ro.local" } } */ -/* { dg-final { scan-assembler-symbol-section {ar} {^\.(const|rodata)} } } */ +/* { dg-final { scan-assembler-symbol-section {ar} {^\.(const|rodata)|\[RO\]} } } */ /* { dg-require-effective-target label_values } */ /* { dg-require-effective-target indirect_jumps } */ diff --git a/gcc/testsuite/gcc.dg/array-quals-1.c b/gcc/testsuite/gcc.dg/array-quals-1.c index 819bd24af76b..31aa1d3cb3fc 100644 --- a/gcc/testsuite/gcc.dg/array-quals-1.c +++ b/gcc/testsuite/gcc.dg/array-quals-1.c @@ -6,46 +6,46 @@ /* { dg-options "-Wno-discarded-array-qualifiers" } */ /* The MMIX port always switches to the .data section at the end of a file. */ /* { dg-final { scan-assembler-not "\\.data(?!\\.rel\\.ro)" { xfail powerpc*-*-aix* mmix-*-* x86_64-*-mingw* } } } */ -/* { dg-final { scan-assembler-symbol-section {^_?a$} {^\.(const|rodata)} } } */ +/* { dg-final { scan-assembler-symbol-section {^_?a$} {^\.(const|rodata)|\[RO\]} } } */ static const int a[2] = { 1, 2 }; -/* { dg-final { scan-assembler-symbol-section {^_?a1$} {^\.(const|rodata)} } } */ +/* { dg-final { scan-assembler-symbol-section {^_?a1$} {^\.(const|rodata)|\[RO\]} } } */ const int a1[2] = { 1, 2 }; typedef const int ci; -/* { dg-final { scan-assembler-symbol-section {^_?b$} {^\.(const|rodata)} } } */ +/* { dg-final { scan-assembler-symbol-section {^_?b$} {^\.(const|rodata)|\[RO\]} } } */ static ci b[2] = { 3, 4 }; -/* { dg-final { scan-assembler-symbol-section {^_?b1$} {^\.(const|rodata)} } } */ +/* { dg-final { scan-assembler-symbol-section {^_?b1$} {^\.(const|rodata)|\[RO\]} } } */ ci b1[2] = { 3, 4 }; typedef int ia[2]; -/* { dg-final { scan-assembler-symbol-section {^_?c$} {^\.(const|rodata)} } } */ +/* { dg-final { scan-assembler-symbol-section {^_?c$} {^\.(const|rodata)|\[RO\]} } } */ static const ia c = { 5, 6 }; -/* { dg-final { scan-assembler-symbol-section {^_?c1$} {^\.(const|rodata)} } } */ +/* { dg-final { scan-assembler-symbol-section {^_?c1$} {^\.(const|rodata)|\[RO\]} } } */ const ia c1 = { 5, 6 }; typedef const int cia[2]; -/* { dg-final { scan-assembler-symbol-section {^_?d$} {^\.(const|rodata)} } } */ +/* { dg-final { scan-assembler-symbol-section {^_?d$} {^\.(const|rodata)|\[RO\]} } } */ static cia d = { 7, 8 }; -/* { dg-final { scan-assembler-symbol-section {^_?d1$} {^\.(const|rodata)} } } */ +/* { dg-final { scan-assembler-symbol-section {^_?d1$} {^\.(const|rodata)|\[RO\]} } } */ cia d1 = { 7, 8 }; -/* { dg-final { scan-assembler-symbol-section {^_?e$} {^\.(const|rodata)} } } */ +/* { dg-final { scan-assembler-symbol-section {^_?e$} {^\.(const|rodata)|\[RO\]} } } */ static cia e[2] = { { 1, 2 }, { 3, 4 } }; -/* { dg-final { scan-assembler-symbol-section {^_?e1$} {^\.(const|rodata)} } } */ +/* { dg-final { scan-assembler-symbol-section {^_?e1$} {^\.(const|rodata)|\[RO\]} } } */ cia e1[2] = { { 1, 2 }, { 3, 4 } }; -/* { dg-final { scan-assembler-symbol-section {^_?p$} {^\.(const|rodata)} } } */ +/* { dg-final { scan-assembler-symbol-section {^_?p$} {^\.(const|rodata)|\[RW\]} } } */ void *const p = &a; -/* { dg-final { scan-assembler-symbol-section {^_?q$} {^\.(const|rodata)} } } */ +/* { dg-final { scan-assembler-symbol-section {^_?q$} {^\.(const|rodata)|\[RW\]} } } */ void *const q = &b; -/* { dg-final { scan-assembler-symbol-section {^_?r$} {^\.(const|rodata)} } } */ +/* { dg-final { scan-assembler-symbol-section {^_?r$} {^\.(const|rodata)|\[RW\]} } } */ void *const r = &c; -/* { dg-final { scan-assembler-symbol-section {^_?s$} {^\.(const|rodata)} } } */ +/* { dg-final { scan-assembler-symbol-section {^_?s$} {^\.(const|rodata)|\[RW\]} } } */ void *const s = &d; -/* { dg-final { scan-assembler-symbol-section {^_?t$} {^\.(const|rodata)} } } */ +/* { dg-final { scan-assembler-symbol-section {^_?t$} {^\.(const|rodata)|\[RW\]} } } */ void *const t = &e; -/* { dg-final { scan-assembler-symbol-section {^_?p1$} {^\.(const|rodata)} } } */ +/* { dg-final { scan-assembler-symbol-section {^_?p1$} {^\.(const|rodata)|\[RW\]} } } */ void *const p1 = &a1; -/* { dg-final { scan-assembler-symbol-section {^_?q1$} {^\.(const|rodata)} } } */ +/* { dg-final { scan-assembler-symbol-section {^_?q1$} {^\.(const|rodata)|\[RW\]} } } */ void *const q1 = &b1; -/* { dg-final { scan-assembler-symbol-section {^_?r1$} {^\.(const|rodata)} } } */ +/* { dg-final { scan-assembler-symbol-section {^_?r1$} {^\.(const|rodata)|\[RW\]} } } */ void *const r1 = &c1; -/* { dg-final { scan-assembler-symbol-section {^_?s1$} {^\.(const|rodata)} } } */ +/* { dg-final { scan-assembler-symbol-section {^_?s1$} {^\.(const|rodata)|\[RW\]} } } */ void *const s1 = &d1; -/* { dg-final { scan-assembler-symbol-section {^_?t1$} {^\.(const|rodata)} } } */ +/* { dg-final { scan-assembler-symbol-section {^_?t1$} {^\.(const|rodata)|\[RW\]} } } */ void *const t1 = &e1; diff --git a/gcc/testsuite/gcc.dg/pr25376.c b/gcc/testsuite/gcc.dg/pr25376.c index 25f1b66c9bd7..accf3235b67e 100644 --- a/gcc/testsuite/gcc.dg/pr25376.c +++ b/gcc/testsuite/gcc.dg/pr25376.c @@ -7,4 +7,4 @@ void simple (void) } /* { dg-final { scan-assembler "my_named_section" } } */ -/* { dg-final { scan-assembler-symbol-section {simple$} {^my_named_section$} } } */ +/* { dg-final { scan-assembler-symbol-section {simple$} {^\.?my_named_section|simple\[DS\]} } } */ diff --git a/gcc/testsuite/lib/scanasm.exp b/gcc/testsuite/lib/scanasm.exp index 5fb145539f4a..43b76495ad85 100644 --- a/gcc/testsuite/lib/scanasm.exp +++ b/gcc/testsuite/lib/scanasm.exp @@ -303,7 +303,7 @@ proc dg-scan-symbol-section { name testcase output_file symbol_pattern expected_ proc parse_section_of_symbols { filename result } { upvar $result up_result - set section_pattern {^\s*(?:\.section\s+(.*)|(\.const|\.data|\.text)\s*)$} + set section_pattern {^\s*(?:(\.section|\.csect)\s+(.*)|(\.const|\.data|\.text)\s*)$} set label_pattern {^(\S+):$} set fd [open $filename r]