aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorDimitar Dimitrov <dimitar@dinux.eu>2024-07-30 23:08:38 +0300
committerDimitar Dimitrov <dimitar@dinux.eu>2024-08-01 17:57:32 +0300
commit7e88a1a34aae0abd3019423d3ceae045c9931adb (patch)
tree8ce1d14abb826212abfeccba8124e8ec69cdbafc /gcc
parent8d0a6e905ea44fb1cb4bad9c026e03fa07aed8d1 (diff)
downloadgcc-7e88a1a34aae0abd3019423d3ceae045c9931adb.zip
gcc-7e88a1a34aae0abd3019423d3ceae045c9931adb.tar.gz
gcc-7e88a1a34aae0abd3019423d3ceae045c9931adb.tar.bz2
testsuite: Add filters for default_packed targets [PR116155]
A few recent C++ test cases are assuming non-zero structure field padding. Consequently they fail for targets defaulting to packed structure layout. Fix by adding the necessary DejaGnu filters. There are no test result changes for x86_64-pc-linux-gnu: $ dg-cmp-results.sh -v -v "" pre-g++.sum post-g++.sum -> No differences. The tests for pru-unknown-elf changed from FAIL to UNSUPPORTED. PR testsuite/116155 gcc/testsuite/ChangeLog: * g++.dg/abi/nsdmi-aggr1a.C: Disable test for effective default_packed targets. * g++.dg/abi/nullptr-align2.C: Ignore warning for default_packed targets. * g++.dg/cpp1z/aligned-new9.C: Disable test for effective default_packed targets. * g++.dg/cpp2a/bit-cast5.C: Ignore dg-error for default_packed targets. * g++.dg/pr53037-1.C: Match any default packing value. * g++.dg/warn/Wpadded-1.C: Ignore warning for default_packed targets. Signed-off-by: Dimitar Dimitrov <dimitar@dinux.eu>
Diffstat (limited to 'gcc')
-rw-r--r--gcc/testsuite/g++.dg/abi/nsdmi-aggr1a.C2
-rw-r--r--gcc/testsuite/g++.dg/abi/nullptr-align2.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp1z/aligned-new9.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/bit-cast5.C6
-rw-r--r--gcc/testsuite/g++.dg/pr53037-1.C4
-rw-r--r--gcc/testsuite/g++.dg/warn/Wpadded-1.C2
6 files changed, 9 insertions, 9 deletions
diff --git a/gcc/testsuite/g++.dg/abi/nsdmi-aggr1a.C b/gcc/testsuite/g++.dg/abi/nsdmi-aggr1a.C
index e7a509d..90526e8 100644
--- a/gcc/testsuite/g++.dg/abi/nsdmi-aggr1a.C
+++ b/gcc/testsuite/g++.dg/abi/nsdmi-aggr1a.C
@@ -1,5 +1,5 @@
// PR c++/103681
-// { dg-do compile { target c++11 } }
+// { dg-do compile { target { { c++11 } && { ! default_packed } } } }
// { dg-additional-options "-fabi-version=0 -Wabi=16" }
struct A {
diff --git a/gcc/testsuite/g++.dg/abi/nullptr-align2.C b/gcc/testsuite/g++.dg/abi/nullptr-align2.C
index 66a9011..0f18a91 100644
--- a/gcc/testsuite/g++.dg/abi/nullptr-align2.C
+++ b/gcc/testsuite/g++.dg/abi/nullptr-align2.C
@@ -16,5 +16,5 @@ struct B
struct C
{
char c;
- decltype(nullptr) n; // { dg-warning "alignment" }
+ decltype(nullptr) n; // { dg-warning "alignment" "" { target { ! default_packed } } }
};
diff --git a/gcc/testsuite/g++.dg/cpp1z/aligned-new9.C b/gcc/testsuite/g++.dg/cpp1z/aligned-new9.C
index dc5cff6..0011390 100644
--- a/gcc/testsuite/g++.dg/cpp1z/aligned-new9.C
+++ b/gcc/testsuite/g++.dg/cpp1z/aligned-new9.C
@@ -1,5 +1,5 @@
// PR c++/102071
-// { dg-do run { target c++17 } }
+// { dg-do run { target { { c++17 } && { ! default_packed } } } }
// { dg-additional-options -faligned-new=2 }
// { dg-xfail-run-if "AIX operator new" { powerpc-ibm-aix* } }
diff --git a/gcc/testsuite/g++.dg/cpp2a/bit-cast5.C b/gcc/testsuite/g++.dg/cpp2a/bit-cast5.C
index 9d536d1..5d0d2b3 100644
--- a/gcc/testsuite/g++.dg/cpp2a/bit-cast5.C
+++ b/gcc/testsuite/g++.dg/cpp2a/bit-cast5.C
@@ -21,7 +21,7 @@ f2 ()
{
A a;
a.a = 1; a.b = 2; a.c = 3; a.e = 4; a.f = 5;
- C b = __builtin_bit_cast (C, a); // { dg-error "'__builtin_bit_cast' accessing uninitialized byte at offset 3" }
+ C b = __builtin_bit_cast (C, a); // { dg-error "'__builtin_bit_cast' accessing uninitialized byte at offset 3" "" { target { ! default_packed } } }
return false;
}
@@ -48,7 +48,7 @@ f5 ()
{
D a;
a.b = 1;
- E b = __builtin_bit_cast (E, a); // { dg-error "'__builtin_bit_cast' accessing uninitialized byte at offset 3" }
+ E b = __builtin_bit_cast (E, a); // { dg-error "'__builtin_bit_cast' accessing uninitialized byte at offset 3" "" { target { ! default_packed } } }
return false;
}
@@ -57,7 +57,7 @@ f6 ()
{
D a;
a.c = 1;
- E b = __builtin_bit_cast (E, a); // { dg-error "'__builtin_bit_cast' accessing uninitialized byte at offset 2" }
+ E b = __builtin_bit_cast (E, a); // { dg-error "'__builtin_bit_cast' accessing uninitialized byte at offset 2" "" { target { ! default_packed } } }
return false;
}
diff --git a/gcc/testsuite/g++.dg/pr53037-1.C b/gcc/testsuite/g++.dg/pr53037-1.C
index a3d8f99..b8948c0 100644
--- a/gcc/testsuite/g++.dg/pr53037-1.C
+++ b/gcc/testsuite/g++.dg/pr53037-1.C
@@ -35,7 +35,7 @@ struct foo4
__u64 x;
} __attribute__((aligned(8)));
-struct foo5 /* { dg-warning "alignment 4 of 'foo5' is less than 16" } */
+struct foo5 /* { dg-warning "alignment \[0-9\]+ of 'foo5' is less than 16" } */
{
int i1;
int x __attribute__((warn_if_not_aligned(16))); /* { dg-warning "'foo5::x' offset 4 in 'foo5' isn't aligned to 16" } */
@@ -68,7 +68,7 @@ union bar2
__u64 x;
} __attribute__((aligned(8)));
-union bar3 /* { dg-warning "alignment 4 of 'bar3' is less than 16" } */
+union bar3 /* { dg-warning "alignment \[0-9\]+ of 'bar3' is less than 16" } */
{
int i1;
int x __attribute__((warn_if_not_aligned(16)));
diff --git a/gcc/testsuite/g++.dg/warn/Wpadded-1.C b/gcc/testsuite/g++.dg/warn/Wpadded-1.C
index af375a4..e5bb6b9 100644
--- a/gcc/testsuite/g++.dg/warn/Wpadded-1.C
+++ b/gcc/testsuite/g++.dg/warn/Wpadded-1.C
@@ -3,7 +3,7 @@
// { dg-options "-Wpadded" }
template <class> struct A;
-template <typename> struct B { // { dg-warning "padding struct size to alignment boundary" }
+template <typename> struct B { // { dg-warning "padding struct size to alignment boundary" "" { target { ! default_packed } } }
long long _M_off;
char _M_state;
};