aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2021-06-20 17:23:52 -0600
committerTom Tromey <tom@tromey.com>2021-06-20 17:23:52 -0600
commit485f4cf7a672b66c1a15c6bdf275f2f06c173f56 (patch)
treeea151c53744428c8ae9984bac03e25c279e0b533
parent8528f4b25f59cf10c093715d56f7a37c4ab6b732 (diff)
downloadgcc-485f4cf7a672b66c1a15c6bdf275f2f06c173f56.zip
gcc-485f4cf7a672b66c1a15c6bdf275f2f06c173f56.tar.gz
gcc-485f4cf7a672b66c1a15c6bdf275f2f06c173f56.tar.bz2
Fix up test suite buglets
Mark Wielaard pointed out that the i8u8.rs test that I recently introduced has a bug: it checks the DW_AT_language attribute, not DW_AT_encoding. Sorry about this. This patch fixes this problem. I've verified that this notices the failure after temporarily backing out the corresponding GCC change. This patch also fixes another problem that he found, namely that it's possible for these tests to find the wrong answer, because the hex value that is checked for might be a prefix of some longer value. This patch also adds a whitespace check to avoid this potential problem.
-rw-r--r--gcc/testsuite/rust/debug/chartype.rs2
-rw-r--r--gcc/testsuite/rust/debug/i8u8.rs4
-rw-r--r--gcc/testsuite/rust/debug/lang.rs2
-rw-r--r--gcc/testsuite/rust/debug/oldlang.rs2
4 files changed, 5 insertions, 5 deletions
diff --git a/gcc/testsuite/rust/debug/chartype.rs b/gcc/testsuite/rust/debug/chartype.rs
index 5504481..69e7ab0 100644
--- a/gcc/testsuite/rust/debug/chartype.rs
+++ b/gcc/testsuite/rust/debug/chartype.rs
@@ -6,5 +6,5 @@ fn main () {
// DW_ATE_UTF entered in DWARF 4.
// { dg-options "-w -gdwarf-4 -dA" }
// DW_ATE_UTF = 0x10
-// { dg-final { scan-assembler "0x10\[^\n\r]* DW_AT_encoding" } } */
+// { dg-final { scan-assembler "0x10\[ \t]\[^\n\r]* DW_AT_encoding" } } */
}
diff --git a/gcc/testsuite/rust/debug/i8u8.rs b/gcc/testsuite/rust/debug/i8u8.rs
index 8f0dd19..1cd21a4 100644
--- a/gcc/testsuite/rust/debug/i8u8.rs
+++ b/gcc/testsuite/rust/debug/i8u8.rs
@@ -6,7 +6,7 @@ fn main () {
// Use -w to avoid warnings about the unused variables
// { dg-options "-w -g -dA" }
// DW_ATE_signed_char = 6
-// { dg-final { scan-assembler-not "0x6\[^\n\r]* DW_AT_language" } } */
+// { dg-final { scan-assembler-not "0x6\[ \t]\[^\n\r]* DW_AT_encoding" } } */
// DW_ATE_unsigned_char = 8
-// { dg-final { scan-assembler-not "0x8\[^\n\r]* DW_AT_language" } } */
+// { dg-final { scan-assembler-not "0x8\[ \t]\[^\n\r]* DW_AT_encoding" } } */
}
diff --git a/gcc/testsuite/rust/debug/lang.rs b/gcc/testsuite/rust/debug/lang.rs
index eec5264..12e0b58 100644
--- a/gcc/testsuite/rust/debug/lang.rs
+++ b/gcc/testsuite/rust/debug/lang.rs
@@ -2,5 +2,5 @@ fn main () {
// { dg-do compile }
// { dg-options "-gdwarf-5 -dA" }
// DW_LANG_Rust is 0x1c
-// { dg-final { scan-assembler "0x1c\[^\n\r]* DW_AT_language" } } */
+// { dg-final { scan-assembler "0x1c\[ \t]\[^\n\r]* DW_AT_language" } } */
}
diff --git a/gcc/testsuite/rust/debug/oldlang.rs b/gcc/testsuite/rust/debug/oldlang.rs
index d80a5db..ddacf0e 100644
--- a/gcc/testsuite/rust/debug/oldlang.rs
+++ b/gcc/testsuite/rust/debug/oldlang.rs
@@ -2,5 +2,5 @@ fn main () {
// { dg-do compile }
// { dg-options "-gstrict-dwarf -gdwarf-3 -dA" }
// DW_LANG_Rust_old is 0x9000
-// { dg-final { scan-assembler "0x9000\[^\n\r]* DW_AT_language" } } */
+// { dg-final { scan-assembler "0x9000\[ \t]\[^\n\r]* DW_AT_language" } } */
}