diff --git a/gcc/testsuite/gcc.dg/guality/asm-1.c b/gcc/testsuite/gcc.dg/guality/asm-1.c
index e9cf4a167aa..089badf812a 100644
--- a/gcc/testsuite/gcc.dg/guality/asm-1.c
+++ b/gcc/testsuite/gcc.dg/guality/asm-1.c
@@ -10,7 +10,7 @@ foo (struct A *p, char *q)
 {
   int f = &p->z[p->y] - q;
   asm volatile (NOP);
-  asm volatile (NOP : : "g" (f));		/* { dg-final { gdb-test 14 "f" "14" } } */
+  asm volatile (NOP : : "g" (f));		/* { dg-final { gdb-test .+1 "f" "14" } } */
   asm volatile ("" : : "g" (p), "g" (q));
 }
 
diff --git a/gcc/testsuite/gcc.dg/guality/bswaptest.c b/gcc/testsuite/gcc.dg/guality/bswaptest.c
index c924f6e2fc8..8d70cb3c5c8 100644
--- a/gcc/testsuite/gcc.dg/guality/bswaptest.c
+++ b/gcc/testsuite/gcc.dg/guality/bswaptest.c
@@ -9,7 +9,7 @@ foo (long x)
   long f = __builtin_bswap64 (x);
   long g = f;
   asm volatile ("" : "+r" (f));
-  vv++;		/* { dg-final { gdb-test 12 "g" "f" } } */
+  vv++;		/* { dg-final { gdb-test . "g" "f" } } */
   return f;
 }
 
@@ -19,7 +19,7 @@ bar (int x)
   int f = __builtin_bswap32 (x);
   int g = f;
   asm volatile ("" : "+r" (f));
-  vv++;		/* { dg-final { gdb-test 22 "g" "f" } } */
+  vv++;		/* { dg-final { gdb-test . "g" "f" } } */
   return f;
 }
 
diff --git a/gcc/testsuite/gcc.dg/guality/clztest.c b/gcc/testsuite/gcc.dg/guality/clztest.c
index b91059cc78e..f89c1c31a15 100644
--- a/gcc/testsuite/gcc.dg/guality/clztest.c
+++ b/gcc/testsuite/gcc.dg/guality/clztest.c
@@ -9,7 +9,7 @@ foo (long x)
   long f = __builtin_clzl (x);
   long g = f;
   asm volatile ("" : "+r" (f));
-  vv++;		/* { dg-final { gdb-test 12 "g" "f" } } */
+  vv++;		/* { dg-final { gdb-test . "g" "f" } } */
   return f;
 }
 
@@ -19,7 +19,7 @@ bar (long x)
   long f = __builtin_clzl (x);
   long g = f;
   asm volatile ("" : "+r" (f));
-  vv++;		/* { dg-final { gdb-test 22 "g" "f" } } */
+  vv++;		/* { dg-final { gdb-test . "g" "f" } } */
   return f;
 }
 
diff --git a/gcc/testsuite/gcc.dg/guality/csttest.c b/gcc/testsuite/gcc.dg/guality/csttest.c
index 05e1ad7249c..e2b6f02520b 100644
--- a/gcc/testsuite/gcc.dg/guality/csttest.c
+++ b/gcc/testsuite/gcc.dg/guality/csttest.c
@@ -8,24 +8,24 @@ __attribute__((noinline, noclone))
 unsigned long long
 foo (unsigned long long x)
 {
-  unsigned long long a = x * (0x17ULL << 31);	/* { dg-final { gdb-test 29 "a" "(0x17ULL << 31)" } } */
-  unsigned long long b = x * (0x7ULL << 33);	/* { dg-final { gdb-test 29 "b" "(0x7ULL << 33)" } } */
-  unsigned long long c = x * (0x1ULL << 35);	/* { dg-final { gdb-test 29 "c" "(0x1ULL << 35)" } } */
-  unsigned long long d = x * (0x17ULL << 15);	/* { dg-final { gdb-test 29 "d" "(0x17ULL << 15)" } } */
-  unsigned long long e = x * (0x17ULL << 50);	/* { dg-final { gdb-test 29 "e" "(0x17ULL << 50)" } } */
-  unsigned long long f = x * (0x37ULL << 31);	/* { dg-final { gdb-test 29 "f" "(0x37ULL << 31)" } } */
-  unsigned long long g = x * (0x37ULL << 50);	/* { dg-final { gdb-test 29 "g" "(0x37ULL << 50)" } } */
-  unsigned long long h = x * (0x1efULL << 33);	/* { dg-final { gdb-test 29 "h" "(0x1efULL << 33)" } } */
-  unsigned long long i = x * (0x1efULL << 50);	/* { dg-final { gdb-test 29 "i" "(0x1efULL << 50)" } } */
-  unsigned long long j = x * -(0x17ULL << 31);	/* { dg-final { gdb-test 29 "j" "-(0x17ULL << 31)" } } */
-  unsigned long long k = x * -(0x7ULL << 33);	/* { dg-final { gdb-test 29 "k" "-(0x7ULL << 33)" } } */
-  unsigned long long l = x * -(0x1ULL << 35);	/* { dg-final { gdb-test 29 "l" "-(0x1ULL << 35)" } } */
-  unsigned long long m = x * -(0x17ULL << 15);	/* { dg-final { gdb-test 29 "m" "-(0x17ULL << 15)" } } */
-  unsigned long long n = x * -(0x17ULL << 50);	/* { dg-final { gdb-test 29 "n" "-(0x17ULL << 50)" } } */
-  unsigned long long o = x * -(0x37ULL << 31);	/* { dg-final { gdb-test 29 "o" "-(0x37ULL << 31)" } } */
-  unsigned long long p = x * -(0x37ULL << 50);	/* { dg-final { gdb-test 29 "p" "-(0x37ULL << 50)" } } */
-  unsigned long long q = x * -(0x1efULL << 33);	/* { dg-final { gdb-test 29 "q" "-(0x1efULL << 33)" } } */
-  unsigned long long r = x * -(0x1efULL << 50);	/* { dg-final { gdb-test 29 "r" "-(0x1efULL << 50)" } } */
+  unsigned long long a = x * (0x17ULL << 31);	/* { dg-final { gdb-test .+18 "a" "(0x17ULL << 31)" } } */
+  unsigned long long b = x * (0x7ULL << 33);	/* { dg-final { gdb-test .+17 "b" "(0x7ULL << 33)" } } */
+  unsigned long long c = x * (0x1ULL << 35);	/* { dg-final { gdb-test .+16 "c" "(0x1ULL << 35)" } } */
+  unsigned long long d = x * (0x17ULL << 15);	/* { dg-final { gdb-test .+15 "d" "(0x17ULL << 15)" } } */
+  unsigned long long e = x * (0x17ULL << 50);	/* { dg-final { gdb-test .+14 "e" "(0x17ULL << 50)" } } */
+  unsigned long long f = x * (0x37ULL << 31);	/* { dg-final { gdb-test .+13 "f" "(0x37ULL << 31)" } } */
+  unsigned long long g = x * (0x37ULL << 50);	/* { dg-final { gdb-test .+12 "g" "(0x37ULL << 50)" } } */
+  unsigned long long h = x * (0x1efULL << 33);	/* { dg-final { gdb-test .+11 "h" "(0x1efULL << 33)" } } */
+  unsigned long long i = x * (0x1efULL << 50);	/* { dg-final { gdb-test .+10 "i" "(0x1efULL << 50)" } } */
+  unsigned long long j = x * -(0x17ULL << 31);	/* { dg-final { gdb-test .+9 "j" "-(0x17ULL << 31)" } } */
+  unsigned long long k = x * -(0x7ULL << 33);	/* { dg-final { gdb-test .+8 "k" "-(0x7ULL << 33)" } } */
+  unsigned long long l = x * -(0x1ULL << 35);	/* { dg-final { gdb-test .+7 "l" "-(0x1ULL << 35)" } } */
+  unsigned long long m = x * -(0x17ULL << 15);	/* { dg-final { gdb-test .+6 "m" "-(0x17ULL << 15)" } } */
+  unsigned long long n = x * -(0x17ULL << 50);	/* { dg-final { gdb-test .+5 "n" "-(0x17ULL << 50)" } } */
+  unsigned long long o = x * -(0x37ULL << 31);	/* { dg-final { gdb-test .+4 "o" "-(0x37ULL << 31)" } } */
+  unsigned long long p = x * -(0x37ULL << 50);	/* { dg-final { gdb-test .+3 "p" "-(0x37ULL << 50)" } } */
+  unsigned long long q = x * -(0x1efULL << 33);	/* { dg-final { gdb-test .+2 "q" "-(0x1efULL << 33)" } } */
+  unsigned long long r = x * -(0x1efULL << 50);	/* { dg-final { gdb-test .+1 "r" "-(0x1efULL << 50)" } } */
   v++;
   return x;
 }
@@ -34,24 +34,24 @@ __attribute__((noinline, noclone))
 unsigned long long
 bar (unsigned long long x)
 {
-  unsigned long long a = (x & 255) + (0x17ULL << 31);	/* { dg-final { gdb-test 55 "a" "(0x17ULL << 31)" } } */
-  unsigned long long b = (x & 255) + (0x7ULL << 33);	/* { dg-final { gdb-test 55 "b" "(0x7ULL << 33)" } } */
-  unsigned long long c = (x & 255) + (0x1ULL << 35);	/* { dg-final { gdb-test 55 "c" "(0x1ULL << 35)" } } */
-  unsigned long long d = (x & 255) + (0x17ULL << 15);	/* { dg-final { gdb-test 55 "d" "(0x17ULL << 15)" } } */
-  unsigned long long e = (x & 255) + (0x17ULL << 50);	/* { dg-final { gdb-test 55 "e" "(0x17ULL << 50)" } } */
-  unsigned long long f = (x & 255) + (0x37ULL << 31);	/* { dg-final { gdb-test 55 "f" "(0x37ULL << 31)" } } */
-  unsigned long long g = (x & 255) + (0x37ULL << 50);	/* { dg-final { gdb-test 55 "g" "(0x37ULL << 50)" } } */
-  unsigned long long h = (x & 255) + (0x1efULL << 33);	/* { dg-final { gdb-test 55 "h" "(0x1efULL << 33)" } } */
-  unsigned long long i = (x & 255) + (0x1efULL << 50);	/* { dg-final { gdb-test 55 "i" "(0x1efULL << 50)" } } */
-  unsigned long long j = (x & 255) + -(0x17ULL << 31);	/* { dg-final { gdb-test 55 "j" "-(0x17ULL << 31)" } } */
-  unsigned long long k = (x & 255) + -(0x7ULL << 33);	/* { dg-final { gdb-test 55 "k" "-(0x7ULL << 33)" } } */
-  unsigned long long l = (x & 255) + -(0x1ULL << 35);	/* { dg-final { gdb-test 55 "l" "-(0x1ULL << 35)" } } */
-  unsigned long long m = (x & 255) + -(0x17ULL << 15);	/* { dg-final { gdb-test 55 "m" "-(0x17ULL << 15)" } } */
-  unsigned long long n = (x & 255) + -(0x17ULL << 50);	/* { dg-final { gdb-test 55 "n" "-(0x17ULL << 50)" } } */
-  unsigned long long o = (x & 255) + -(0x37ULL << 31);	/* { dg-final { gdb-test 55 "o" "-(0x37ULL << 31)" } } */
-  unsigned long long p = (x & 255) + -(0x37ULL << 50);	/* { dg-final { gdb-test 55 "p" "-(0x37ULL << 50)" } } */
-  unsigned long long q = (x & 255) + -(0x1efULL << 33);	/* { dg-final { gdb-test 55 "q" "-(0x1efULL << 33)" } } */
-  unsigned long long r = (x & 255) + -(0x1efULL << 50);	/* { dg-final { gdb-test 55 "r" "-(0x1efULL << 50)" } } */
+  unsigned long long a = (x & 255) + (0x17ULL << 31);	/* { dg-final { gdb-test .+18 "a" "(0x17ULL << 31)" } } */
+  unsigned long long b = (x & 255) + (0x7ULL << 33);	/* { dg-final { gdb-test .+17 "b" "(0x7ULL << 33)" } } */
+  unsigned long long c = (x & 255) + (0x1ULL << 35);	/* { dg-final { gdb-test .+16 "c" "(0x1ULL << 35)" } } */
+  unsigned long long d = (x & 255) + (0x17ULL << 15);	/* { dg-final { gdb-test .+15 "d" "(0x17ULL << 15)" } } */
+  unsigned long long e = (x & 255) + (0x17ULL << 50);	/* { dg-final { gdb-test .+14 "e" "(0x17ULL << 50)" } } */
+  unsigned long long f = (x & 255) + (0x37ULL << 31);	/* { dg-final { gdb-test .+13 "f" "(0x37ULL << 31)" } } */
+  unsigned long long g = (x & 255) + (0x37ULL << 50);	/* { dg-final { gdb-test .+12 "g" "(0x37ULL << 50)" } } */
+  unsigned long long h = (x & 255) + (0x1efULL << 33);	/* { dg-final { gdb-test .+11 "h" "(0x1efULL << 33)" } } */
+  unsigned long long i = (x & 255) + (0x1efULL << 50);	/* { dg-final { gdb-test .+10 "i" "(0x1efULL << 50)" } } */
+  unsigned long long j = (x & 255) + -(0x17ULL << 31);	/* { dg-final { gdb-test .+9 "j" "-(0x17ULL << 31)" } } */
+  unsigned long long k = (x & 255) + -(0x7ULL << 33);	/* { dg-final { gdb-test .+8 "k" "-(0x7ULL << 33)" } } */
+  unsigned long long l = (x & 255) + -(0x1ULL << 35);	/* { dg-final { gdb-test .+7 "l" "-(0x1ULL << 35)" } } */
+  unsigned long long m = (x & 255) + -(0x17ULL << 15);	/* { dg-final { gdb-test .+6 "m" "-(0x17ULL << 15)" } } */
+  unsigned long long n = (x & 255) + -(0x17ULL << 50);	/* { dg-final { gdb-test .+5 "n" "-(0x17ULL << 50)" } } */
+  unsigned long long o = (x & 255) + -(0x37ULL << 31);	/* { dg-final { gdb-test .+4 "o" "-(0x37ULL << 31)" } } */
+  unsigned long long p = (x & 255) + -(0x37ULL << 50);	/* { dg-final { gdb-test .+3 "p" "-(0x37ULL << 50)" } } */
+  unsigned long long q = (x & 255) + -(0x1efULL << 33);	/* { dg-final { gdb-test .+2 "q" "-(0x1efULL << 33)" } } */
+  unsigned long long r = (x & 255) + -(0x1efULL << 50);	/* { dg-final { gdb-test .+1 "r" "-(0x1efULL << 50)" } } */
   v++;
   return x;
 }
diff --git a/gcc/testsuite/gcc.dg/guality/ctztest.c b/gcc/testsuite/gcc.dg/guality/ctztest.c
index ea8d076d31a..5ce6c674be3 100644
--- a/gcc/testsuite/gcc.dg/guality/ctztest.c
+++ b/gcc/testsuite/gcc.dg/guality/ctztest.c
@@ -9,7 +9,7 @@ foo (long x)
   long f = __builtin_ctzl (x);
   long g = f;
   asm volatile ("" : "+r" (f));
-  vv++;		/* { dg-final { gdb-test 12 "g" "f" } } */
+  vv++;		/* { dg-final { gdb-test . "g" "f" } } */
   return f;
 }
 
@@ -19,7 +19,7 @@ bar (long x)
   long f = __builtin_ctzl (x);
   long g = f;
   asm volatile ("" : "+r" (f));
-  vv++;		/* { dg-final { gdb-test 22 "g" "f" } } */
+  vv++;		/* { dg-final { gdb-test . "g" "f" } } */
   return f;
 }
 
diff --git a/gcc/testsuite/gcc.dg/guality/drap.c b/gcc/testsuite/gcc.dg/guality/drap.c
index 573bb39d08f..f3df96fdb95 100644
--- a/gcc/testsuite/gcc.dg/guality/drap.c
+++ b/gcc/testsuite/gcc.dg/guality/drap.c
@@ -18,8 +18,8 @@ __attribute__((noinline, noclone)) int
 foo (int v0, int v1, int v2, int v3, int v4, int v5, int a, int b)
 {
   __attribute__((aligned (32))) int c = bar (a, b);
-  v++;               /* { dg-final { gdb-test 21 "a" "5" } } */
-  return a + b + c;  /* { dg-final { gdb-test 22 "b" "6" } } */
+  v++;               /* { dg-final { gdb-test . "a" "5" } } */
+  return a + b + c;  /* { dg-final { gdb-test . "b" "6" } } */
 }
 
 int
diff --git a/gcc/testsuite/gcc.dg/guality/nrv-1.c b/gcc/testsuite/gcc.dg/guality/nrv-1.c
index 2f4e654e067..ce9003c21c5 100644
--- a/gcc/testsuite/gcc.dg/guality/nrv-1.c
+++ b/gcc/testsuite/gcc.dg/guality/nrv-1.c
@@ -17,7 +17,7 @@ f ()
   a2.i[0] = 42;
   if (a3.i[0] != 0)
     abort ();
-  a2.i[4] = 7;	/* { dg-final { gdb-test 20 "a2.i\[0\]" "42" } } */
+  a2.i[4] = 7;	/* { dg-final { gdb-test . "a2.i\[0\]" "42" } } */
   return a2;
 }
 
diff --git a/gcc/testsuite/gcc.dg/guality/pr41353-1.c b/gcc/testsuite/gcc.dg/guality/pr41353-1.c
index 1d2cca78707..cd306328fda 100644
--- a/gcc/testsuite/gcc.dg/guality/pr41353-1.c
+++ b/gcc/testsuite/gcc.dg/guality/pr41353-1.c
@@ -7,13 +7,13 @@ int vari __attribute__((used)) = 17, varj;
 __attribute__((noinline)) int
 f1 (void)
 {
-  /* { dg-final { gdb-test 17 "vari" "17" } } */
-  int vari1 = 2 * vari; /* { dg-final { gdb-test 17 "vari1" "2 * 17" } } */
-  int vari2 = 3 * vari; /* { dg-final { gdb-test 17 "vari2" "3 * 17" } } */
-  int vari3 = 2 * vari; /* { dg-final { gdb-test 17 "vari3" "2 * 17" } } */
-  int vari4 = 3 * vari; /* { dg-final { gdb-test 17 "vari4" "3 * 17" } } */
-  int vari5 = 4 * vari; /* { dg-final { gdb-test 17 "vari5" "4 * 17" } } */
-  int vari6 = 5 * vari; /* { dg-final { gdb-test 17 "vari6" "5 * 17" } } */
+  /* { dg-final { gdb-test .+7 "vari" "17" } } */
+  int vari1 = 2 * vari; /* { dg-final { gdb-test .+6 "vari1" "2 * 17" } } */
+  int vari2 = 3 * vari; /* { dg-final { gdb-test .+5 "vari2" "3 * 17" } } */
+  int vari3 = 2 * vari; /* { dg-final { gdb-test .+4 "vari3" "2 * 17" } } */
+  int vari4 = 3 * vari; /* { dg-final { gdb-test .+3 "vari4" "3 * 17" } } */
+  int vari5 = 4 * vari; /* { dg-final { gdb-test .+2 "vari5" "4 * 17" } } */
+  int vari6 = 5 * vari; /* { dg-final { gdb-test .+1 "vari6" "5 * 17" } } */
   return varj;
 }
 
@@ -21,10 +21,10 @@ __attribute__((noinline)) int
 f2 (int i, int j)
 {
   j += i;
-  /* { dg-final { gdb-test 28 "i" "37" } } */
-  /* { dg-final { gdb-test 28 "j" "28 + 37" { xfail *-*-* } } } */
-  int i1 = 2 * i; /* { dg-final { gdb-test 28 "i1" "2 * 37" } } */
-  int i2 = 3 * i; /* { dg-final { gdb-test 28 "i2" "3 * 37" } } */
+  /* { dg-final { gdb-test .+4 "i" "37" } } */
+  /* { dg-final { gdb-test .+3 "j" "28 + 37" { xfail *-*-* } } } */
+  int i1 = 2 * i; /* { dg-final { gdb-test .+2 "i1" "2 * 37" } } */
+  int i2 = 3 * i; /* { dg-final { gdb-test .+1 "i2" "3 * 37" } } */
   return j;
 }
 
@@ -32,10 +32,10 @@ __attribute__((noinline)) int
 f3 (int i)
 {
   asm volatile ("" : "+r" (i));
-  /* { dg-final { gdb-test 39 "i" "12" } } */
-  int i1 = 2 * i; /* { dg-final { gdb-test 39 "i1" "2 * 12" } } */
-  int i2 = 2 * i; /* { dg-final { gdb-test 39 "i2" "2 * 12" } } */
-  int i3 = 3 * i; /* { dg-final { gdb-test 39 "i3" "3 * 12" } } */
+  /* { dg-final { gdb-test .+4 "i" "12" } } */
+  int i1 = 2 * i; /* { dg-final { gdb-test .+3 "i1" "2 * 12" } } */
+  int i2 = 2 * i; /* { dg-final { gdb-test .+2 "i2" "2 * 12" } } */
+  int i3 = 3 * i; /* { dg-final { gdb-test .+1 "i3" "3 * 12" } } */
   return i;
 }
 
diff --git a/gcc/testsuite/gcc.dg/guality/pr41353-2.c b/gcc/testsuite/gcc.dg/guality/pr41353-2.c
index 0983bf4ab59..e3bfe1d93bf 100644
--- a/gcc/testsuite/gcc.dg/guality/pr41353-2.c
+++ b/gcc/testsuite/gcc.dg/guality/pr41353-2.c
@@ -8,8 +8,8 @@ int vari __attribute__((used)) = 17, varj;
 __attribute__((noinline)) int
 f1 (void)
 {
-  int vari1 = 2 * vari; /* { dg-final { gdb-test 13 "vari1" "2 * 17" } } */
-  int vari2 = 3 * vari; /* { dg-final { gdb-test 13 "vari2" "3 * 17" } } */
+  int vari1 = 2 * vari; /* { dg-final { gdb-test .+2 "vari1" "2 * 17" } } */
+  int vari2 = 3 * vari; /* { dg-final { gdb-test .+1 "vari2" "3 * 17" } } */
   return varj;
 }
 
diff --git a/gcc/testsuite/gcc.dg/guality/pr41404-1.c b/gcc/testsuite/gcc.dg/guality/pr41404-1.c
index 59a8293e62f..97ed1e33d4b 100644
--- a/gcc/testsuite/gcc.dg/guality/pr41404-1.c
+++ b/gcc/testsuite/gcc.dg/guality/pr41404-1.c
@@ -7,11 +7,11 @@ int bar1 (int i)
 {
   const char *foo = "foo";
   asm volatile ("" : "+r" (i) : : "memory");
-  i++;	/* { dg-final { gdb-test 10 "*foo" "'f'" } } */
+  i++;	/* { dg-final { gdb-test . "*foo" "'f'" } } */
   asm volatile ("" : "+r" (i) : : "memory");
   foo = "bar";
   asm volatile ("" : "+r" (i) : : "memory");
-  i++;	/* { dg-final { gdb-test 14 "*foo" "'b'" } } */
+  i++;	/* { dg-final { gdb-test . "*foo" "'b'" } } */
   asm volatile ("" : "+r" (i) : : "memory");
   return i;
 }
@@ -21,7 +21,7 @@ int bar2 (int i)
 {
   const char *foo = "foo";
   asm volatile ("" : "+r" (i) : : "memory");
-  i++;	/* { dg-final { gdb-test 24 "*foo" "'f'" } } */
+  i++;	/* { dg-final { gdb-test . "*foo" "'f'" } } */
   asm volatile ("" : "+r" (i) : : "memory");
   return i;
 }
diff --git a/gcc/testsuite/gcc.dg/guality/pr43051-1.c b/gcc/testsuite/gcc.dg/guality/pr43051-1.c
index 77325c97e26..43003045c81 100644
--- a/gcc/testsuite/gcc.dg/guality/pr43051-1.c
+++ b/gcc/testsuite/gcc.dg/guality/pr43051-1.c
@@ -31,14 +31,14 @@ bar (struct S *c, int v, struct S *e)
 #endif
   while (c < e)
     {
-      foo ("c", (__UINTPTR_TYPE__) c, 0);	/* { dg-final { gdb-test 34 "c" "\&a\[0\]" } } */
-      foo ("v", v, 1);				/* { dg-final { gdb-test 35 "v" "1" } } */
-      foo ("e", (__UINTPTR_TYPE__) e, 2);	/* { dg-final { gdb-test 36 "e" "\&a\[1\]" } } */
+      foo ("c", (__UINTPTR_TYPE__) c, 0);	/* { dg-final { gdb-test . "c" "\&a\[0\]" } } */
+      foo ("v", v, 1);				/* { dg-final { gdb-test . "v" "1" } } */
+      foo ("e", (__UINTPTR_TYPE__) e, 2);	/* { dg-final { gdb-test . "e" "\&a\[1\]" } } */
       if (c->v == v)
 	return c;
-      foo ("c", (__UINTPTR_TYPE__) c, 3);	/* { dg-final { gdb-test 39 "c" "\&a\[0\]" } } */
-      foo ("v", v, 4);				/* { dg-final { gdb-test 40 "v" "1" } } */
-      foo ("e", (__UINTPTR_TYPE__) e, 5);	/* { dg-final { gdb-test 41 "e" "\&a\[1\]" } } */
+      foo ("c", (__UINTPTR_TYPE__) c, 3);	/* { dg-final { gdb-test . "c" "\&a\[0\]" } } */
+      foo ("v", v, 4);				/* { dg-final { gdb-test . "v" "1" } } */
+      foo ("e", (__UINTPTR_TYPE__) e, 5);	/* { dg-final { gdb-test . "e" "\&a\[1\]" } } */
       c++;
     }
 #ifdef __i386__
diff --git a/gcc/testsuite/gcc.dg/guality/pr43077-1.c b/gcc/testsuite/gcc.dg/guality/pr43077-1.c
index 84bd59ef5f3..39bd26aae01 100644
--- a/gcc/testsuite/gcc.dg/guality/pr43077-1.c
+++ b/gcc/testsuite/gcc.dg/guality/pr43077-1.c
@@ -7,16 +7,16 @@ int varb;
 int __attribute__((noinline))
 fn1 (void)
 {
-  int vara = (varb == 3);		/* { dg-final { gdb-test 11 "vara" "0" } } */
-  asm volatile ("" : : "g" (vara));	/* { dg-final { gdb-test 11 "varb" "2" } } */
+  int vara = (varb == 3);		/* { dg-final { gdb-test .+1 "vara" "0" } } */
+  asm volatile ("" : : "g" (vara));	/* { dg-final { gdb-test . "varb" "2" } } */
   return 0;
 }
 
 int __attribute__((noinline))
 fn2 (void)
 {
-  int vara = (varb == 3);		/* { dg-final { gdb-test 19 "vara" "1" } } */
-  asm volatile ("" : : "g" (vara));	/* { dg-final { gdb-test 19 "varb" "3" } } */
+  int vara = (varb == 3);		/* { dg-final { gdb-test .+1 "vara" "1" } } */
+  asm volatile ("" : : "g" (vara));	/* { dg-final { gdb-test . "varb" "3" } } */
   return 0;
 }
 
@@ -33,12 +33,12 @@ fn3 (void)
 {
   unsigned long a = 0, b = 0, c = 0;
   a = foo (&b, &c);
-					/* { dg-final { gdb-test 42 "a" "1" } } */
-					/* { dg-final { gdb-test 42 "b" "2" } } */
-					/* { dg-final { gdb-test 42 "c" "3" } } */
-  unsigned long vara = a;		/* { dg-final { gdb-test 42 "vara" "1" } } */
-  unsigned long varb = b;		/* { dg-final { gdb-test 42 "varb" "2" } } */
-  unsigned long varc = c;		/* { dg-final { gdb-test 42 "varc" "3" } } */
+					/* { dg-final { gdb-test .+6 "a" "1" } } */
+					/* { dg-final { gdb-test .+5 "b" "2" } } */
+					/* { dg-final { gdb-test .+4 "c" "3" } } */
+  unsigned long vara = a;		/* { dg-final { gdb-test .+3 "vara" "1" } } */
+  unsigned long varb = b;		/* { dg-final { gdb-test .+2 "varb" "2" } } */
+  unsigned long varc = c;		/* { dg-final { gdb-test .+1 "varc" "3" } } */
   asm volatile ("" : : "g" (vara), "g" (varb), "g" (varc));
   return a;
 }
diff --git a/gcc/testsuite/gcc.dg/guality/pr43177.c b/gcc/testsuite/gcc.dg/guality/pr43177.c
index 563835b630a..cd0ae03b3d9 100644
--- a/gcc/testsuite/gcc.dg/guality/pr43177.c
+++ b/gcc/testsuite/gcc.dg/guality/pr43177.c
@@ -11,8 +11,8 @@ long __attribute__((noinline))
 foo (long x)
 {
   long l = x + 3;
-  bar (l);/* { dg-final { gdb-test 15 "l" "10" } } */
-  bar (l);/* { dg-final { gdb-test 15 "x" "7" } } */
+  bar (l);/* { dg-final { gdb-test .+1 "l" "10" } } */
+  bar (l);/* { dg-final { gdb-test . "x" "7" } } */
   return l;
 }
 
@@ -20,8 +20,8 @@ long __attribute__((noinline))
 baz (int x)
 {
   long l = x + 3;
-  bar (l);/* { dg-final { gdb-test 24 "l" "10" } } */
-  bar (l);/* { dg-final { gdb-test 24 "x" "7" } } */
+  bar (l);/* { dg-final { gdb-test .+1 "l" "10" } } */
+  bar (l);/* { dg-final { gdb-test . "x" "7" } } */
   return l;
 }
 
diff --git a/gcc/testsuite/gcc.dg/guality/pr43329-1.c b/gcc/testsuite/gcc.dg/guality/pr43329-1.c
index 5e27adfca30..62eea07ff3a 100644
--- a/gcc/testsuite/gcc.dg/guality/pr43329-1.c
+++ b/gcc/testsuite/gcc.dg/guality/pr43329-1.c
@@ -8,8 +8,8 @@ static inline void
 foo (int argx)
 {
   int varx = argx;
-  __asm__ volatile (NOP);			/* { dg-final { gdb-test 12 "argx" "25" } } */
-  __asm__ volatile (NOP : : "g" (varx));	/* { dg-final { gdb-test 12 "varx" "25" } } */
+  __asm__ volatile (NOP);			/* { dg-final { gdb-test .+1 "argx" "25" } } */
+  __asm__ volatile (NOP : : "g" (varx));	/* { dg-final { gdb-test . "varx" "25" } } */
 }
 
 int i;
diff --git a/gcc/testsuite/gcc.dg/guality/pr43479.c b/gcc/testsuite/gcc.dg/guality/pr43479.c
index e0bc246cdae..82555bcabaf 100644
--- a/gcc/testsuite/gcc.dg/guality/pr43479.c
+++ b/gcc/testsuite/gcc.dg/guality/pr43479.c
@@ -10,13 +10,13 @@ foo (int k, int l, int m, int n)
     int h = n;
     {
       int i = k;
-      k++;	/* { dg-final { gdb-test 13 "i" "6" } } */
-    }		/* { dg-final { gdb-test 13 "h" "9" } } */
-		/* { dg-final { gdb-test 13 "n" "9" } } */
+      k++;	/* { dg-final { gdb-test . "i" "6" } } */
+    }		/* { dg-final { gdb-test .-1 "h" "9" } } */
+		/* { dg-final { gdb-test .-2 "n" "9" } } */
     {
       int j = m;
-      m++;	/* { dg-final { gdb-test 18 "j" "8" } } */
-    }		/* { dg-final { gdb-test 18 "h" "9" } } */
+      m++;	/* { dg-final { gdb-test . "j" "8" } } */
+    }		/* { dg-final { gdb-test .-1 "h" "9" } } */
 		/* { dg-final { gdb-test 12 "n" "9" } } */
   }
   asm volatile ("" : : "r" (k), "r" (l));
diff --git a/gcc/testsuite/gcc.dg/guality/pr43593.c b/gcc/testsuite/gcc.dg/guality/pr43593.c
index d8cc41359be..131e608d3fe 100644
--- a/gcc/testsuite/gcc.dg/guality/pr43593.c
+++ b/gcc/testsuite/gcc.dg/guality/pr43593.c
@@ -13,7 +13,7 @@ foo (void)
 {
   int i, *j = &i;
   bar (j);
-  return 6 + i;	/* { dg-final { gdb-test 16 "j" "&i" } } */
+  return 6 + i;	/* { dg-final { gdb-test . "j" "&i" } } */
 }
 
 int
diff --git a/gcc/testsuite/gcc.dg/guality/pr45003-1.c b/gcc/testsuite/gcc.dg/guality/pr45003-1.c
index 9fc22f22b1e..5823ce76842 100644
--- a/gcc/testsuite/gcc.dg/guality/pr45003-1.c
+++ b/gcc/testsuite/gcc.dg/guality/pr45003-1.c
@@ -7,7 +7,7 @@ foo (unsigned short *p)
 {
   int a = *p;
   asm volatile ("nop");
-  asm volatile ("nop" : : "D" (a));	/* { dg-final { gdb-test 10 "a" "0x8078" } } */
+  asm volatile ("nop" : : "D" (a));	/* { dg-final { gdb-test . "a" "0x8078" } } */
   return 0;
 }
 
@@ -16,7 +16,7 @@ bar (short *p)
 {
   unsigned int a = *p;
   asm volatile ("nop");
-  asm volatile ("nop" : : "D" (a));	/* { dg-final { gdb-test 19 "a" "0xffff8078" } } */
+  asm volatile ("nop" : : "D" (a));	/* { dg-final { gdb-test . "a" "0xffff8078" } } */
   return 0;
 }
 
diff --git a/gcc/testsuite/gcc.dg/guality/pr45003-2.c b/gcc/testsuite/gcc.dg/guality/pr45003-2.c
index 7e395d43e16..76cf7615e43 100644
--- a/gcc/testsuite/gcc.dg/guality/pr45003-2.c
+++ b/gcc/testsuite/gcc.dg/guality/pr45003-2.c
@@ -7,7 +7,7 @@ foo (unsigned short *p)
 {
   int a = *p;
   asm volatile ("nop" : : "D" ((int) *p));
-  asm volatile ("nop" : : "D" ((int) *p));	/* { dg-final { gdb-test 10 "a" "0x8078" } } */
+  asm volatile ("nop" : : "D" ((int) *p));	/* { dg-final { gdb-test . "a" "0x8078" } } */
   return 0;
 }
 
@@ -16,7 +16,7 @@ bar (short *p)
 {
   unsigned int a = *p;
   asm volatile ("nop" : : "D" ((unsigned int) *p));
-  asm volatile ("nop" : : "D" ((unsigned int) *p));	/* { dg-final { gdb-test 19 "a" "0xffff8078" } } */
+  asm volatile ("nop" : : "D" ((unsigned int) *p));	/* { dg-final { gdb-test . "a" "0xffff8078" } } */
   return 0;
 }
 
diff --git a/gcc/testsuite/gcc.dg/guality/pr45003-3.c b/gcc/testsuite/gcc.dg/guality/pr45003-3.c
index 5a7c5a8a0c4..e9a8c865b35 100644
--- a/gcc/testsuite/gcc.dg/guality/pr45003-3.c
+++ b/gcc/testsuite/gcc.dg/guality/pr45003-3.c
@@ -7,7 +7,7 @@ foo (unsigned short *p)
 {
   int a = (short) *p;
   asm volatile ("nop" : : "D" ((int) *p));
-  asm volatile ("nop" : : "D" ((int) *p));	/* { dg-final { gdb-test 10 "a" "-32648" } } */
+  asm volatile ("nop" : : "D" ((int) *p));	/* { dg-final { gdb-test . "a" "-32648" } } */
   return 0;
 }
 
@@ -16,7 +16,7 @@ bar (short *p)
 {
   unsigned int a = (unsigned short) *p;
   asm volatile ("nop" : : "D" ((unsigned int) *p));
-  asm volatile ("nop" : : "D" ((unsigned int) *p));	/* { dg-final { gdb-test 19 "a" "0x8078" } } */
+  asm volatile ("nop" : : "D" ((unsigned int) *p));	/* { dg-final { gdb-test . "a" "0x8078" } } */
   return 0;
 }
 
diff --git a/gcc/testsuite/gcc.dg/guality/pr48437.c b/gcc/testsuite/gcc.dg/guality/pr48437.c
index 5346baa0bd8..f7516b8e979 100644
--- a/gcc/testsuite/gcc.dg/guality/pr48437.c
+++ b/gcc/testsuite/gcc.dg/guality/pr48437.c
@@ -11,7 +11,7 @@ int main()
   for (i = 3; i < 7; ++i)
     {
       extern int i;
-      asm volatile (NOP : : : "memory"); /* { dg-final { gdb-test 14 "i" "0" } } */
+      asm volatile (NOP : : : "memory"); /* { dg-final { gdb-test . "i" "0" } } */
     }
   return 0;
 }
diff --git a/gcc/testsuite/gcc.dg/guality/pr48466.c b/gcc/testsuite/gcc.dg/guality/pr48466.c
index 8d5426a9989..baef86fa3dd 100644
--- a/gcc/testsuite/gcc.dg/guality/pr48466.c
+++ b/gcc/testsuite/gcc.dg/guality/pr48466.c
@@ -32,10 +32,10 @@ main ()
   struct T t;
   struct U x = foo ("this is x");
   struct S y, z;
-  y.b = n;		/* { dg-final { gdb-test 38 "t.a.a" "17" } } */
-  y.a = 0;		/* { dg-final { gdb-test 38 "*t.a.b" "17" } } */
-  bar (&t, 17, 21);	/* { dg-final { gdb-test 38 "t.b.a" "21" } } */
-  v++;			/* { dg-final { gdb-test 38 "*t.b.b" "21" } } */
+  y.b = n;		/* { dg-final { gdb-test .+3 "t.a.a" "17" } } */
+  y.a = 0;		/* { dg-final { gdb-test .+2 "*t.a.b" "17" } } */
+  bar (&t, 17, 21);	/* { dg-final { gdb-test .+1 "t.b.a" "21" } } */
+  v++;			/* { dg-final { gdb-test . "*t.b.b" "21" } } */
   z = y;
   return 0;
 }
diff --git a/gcc/testsuite/gcc.dg/guality/pr49888.c b/gcc/testsuite/gcc.dg/guality/pr49888.c
index 89deca4ac3b..4f3a2501eb7 100644
--- a/gcc/testsuite/gcc.dg/guality/pr49888.c
+++ b/gcc/testsuite/gcc.dg/guality/pr49888.c
@@ -9,13 +9,13 @@ f (int *p)
 {
   int c = *p;
   v = c;
-  *p = 1; /* { dg-final { gdb-test 12 "!!c" "0" } } */
+  *p = 1; /* { dg-final { gdb-test . "!!c" "0" } } */
   /* c may very well be optimized out at this point, so we test !c,
      which will evaluate to the expected value.  We just want to make
      sure it doesn't remain bound to *p as it did before, in which
      case !c would evaluate to 0.  *p may also be regarded as aliasing
      register saves, thus the !!c above.  */
-  v = 0; /* { dg-final { gdb-test 18 "!c" "1" } } */
+  v = 0; /* { dg-final { gdb-test . "!c" "1" } } */
 }
 int
 main ()
diff --git a/gcc/testsuite/gcc.dg/guality/pr54200.c b/gcc/testsuite/gcc.dg/guality/pr54200.c
index e1e72938962..e873d1b7b91 100644
--- a/gcc/testsuite/gcc.dg/guality/pr54200.c
+++ b/gcc/testsuite/gcc.dg/guality/pr54200.c
@@ -17,7 +17,7 @@ foo (int z, int x, int b)
   else
     {
       int a = (x + z) + b;
-      return a; /* { dg-final { gdb-test 20 "z" "3" } } */
+      return a; /* { dg-final { gdb-test . "z" "3" } } */
     }
 }
 
diff --git a/gcc/testsuite/gcc.dg/guality/pr54519-1.c b/gcc/testsuite/gcc.dg/guality/pr54519-1.c
index e98dcb91107..a4105abf99b 100644
--- a/gcc/testsuite/gcc.dg/guality/pr54519-1.c
+++ b/gcc/testsuite/gcc.dg/guality/pr54519-1.c
@@ -15,12 +15,12 @@ fn2 (int x, int y, int z)
   if (x != z)
     {
       fn1 (x);
-      fn1 (x);		/* { dg-final { gdb-test 20 "x" "36" } } */
-      if (x == 36)	/* { dg-final { gdb-test 20 "y" "25" } } */
-	fn1 (x);	/* { dg-final { gdb-test 20 "z" "6" } } */
-      fn1 (x);		/* { dg-final { gdb-test 23 "x" "98" } } */
-      if (x == 98)	/* { dg-final { gdb-test 23 "y" "117" } } */
-	fn1 (x);	/* { dg-final { gdb-test 23 "z" "8" } } */
+      fn1 (x);		/* { dg-final { gdb-test .+2 "x" "36" } } */
+      if (x == 36)	/* { dg-final { gdb-test .+1 "y" "25" } } */
+	fn1 (x);	/* { dg-final { gdb-test . "z" "6" } } */
+      fn1 (x);		/* { dg-final { gdb-test .+2 "x" "98" } } */
+      if (x == 98)	/* { dg-final { gdb-test .+1 "y" "117" } } */
+	fn1 (x);	/* { dg-final { gdb-test . "z" "8" } } */
       fn1 (x);
       fn1 (x + a);
     }
diff --git a/gcc/testsuite/gcc.dg/guality/pr54519-2.c b/gcc/testsuite/gcc.dg/guality/pr54519-2.c
index 4ee3c9e2f84..6bc16830e20 100644
--- a/gcc/testsuite/gcc.dg/guality/pr54519-2.c
+++ b/gcc/testsuite/gcc.dg/guality/pr54519-2.c
@@ -13,13 +13,13 @@ fn2 (int x, int y)
 {
   if (y)
     {
-      fn1 (x);		/* { dg-final { gdb-test 17 "x" "6" } } */
-      fn1 (x);		/* { dg-final { gdb-test 17 "y" "25" } } */
+      fn1 (x);		/* { dg-final { gdb-test .+1 "x" "6" } } */
+      fn1 (x);		/* { dg-final { gdb-test . "y" "25" } } */
       fn1 (x);
       fn1 (x);
       y = -2 + x;
       y = y * y * y + y;
-      fn1 (x + y);	/* { dg-final { gdb-test 22 "y" "68" } } */
+      fn1 (x + y);	/* { dg-final { gdb-test . "y" "68" } } */
     }
   return x;
 }
diff --git a/gcc/testsuite/gcc.dg/guality/pr54519-3.c b/gcc/testsuite/gcc.dg/guality/pr54519-3.c
index aa8369e15b8..da18247b47b 100644
--- a/gcc/testsuite/gcc.dg/guality/pr54519-3.c
+++ b/gcc/testsuite/gcc.dg/guality/pr54519-3.c
@@ -15,12 +15,12 @@ fn2 (int x, int y, int z)
   if (x != z)
     {
       fn1 (x);
-      fn1 (x);		/* { dg-final { gdb-test 20 "x" "36" } } */
-      if (x == 36)	/* { dg-final { gdb-test 20 "y" "25" } } */
-	fn1 (x);	/* { dg-final { gdb-test 20 "z" "6" } } */
-      fn1 (x);		/* { dg-final { gdb-test 23 "x" "98" } } */
-      if (x == 98)	/* { dg-final { gdb-test 23 "y" "117" } } */
-	fn1 (x);	/* { dg-final { gdb-test 23 "z" "8" } } */
+      fn1 (x);		/* { dg-final { gdb-test .+2 "x" "36" } } */
+      if (x == 36)	/* { dg-final { gdb-test .+1 "y" "25" } } */
+	fn1 (x);	/* { dg-final { gdb-test . "z" "6" } } */
+      fn1 (x);		/* { dg-final { gdb-test .+2 "x" "98" } } */
+      if (x == 98)	/* { dg-final { gdb-test .+1 "y" "117" } } */
+	fn1 (x);	/* { dg-final { gdb-test . "z" "8" } } */
       fn1 (x);
       fn1 (x + a);
     }
diff --git a/gcc/testsuite/gcc.dg/guality/pr54519-4.c b/gcc/testsuite/gcc.dg/guality/pr54519-4.c
index d2765d148c2..c82de580bf9 100644
--- a/gcc/testsuite/gcc.dg/guality/pr54519-4.c
+++ b/gcc/testsuite/gcc.dg/guality/pr54519-4.c
@@ -13,13 +13,13 @@ fn2 (int x, int y)
 {
   if (y)
     {
-      fn1 (x);		/* { dg-final { gdb-test 17 "x" "6" } } */
-      fn1 (x);		/* { dg-final { gdb-test 17 "y" "25" } } */
+      fn1 (x);		/* { dg-final { gdb-test .+1 "x" "6" } } */
+      fn1 (x);		/* { dg-final { gdb-test . "y" "25" } } */
       fn1 (x);
       fn1 (x);
       y = -2 + x;
       y = y * y * y + y;
-      fn1 (x + y);	/* { dg-final { gdb-test 22 "y" "68" } } */
+      fn1 (x + y);	/* { dg-final { gdb-test . "y" "68" } } */
     }
   return x;
 }
diff --git a/gcc/testsuite/gcc.dg/guality/pr54519-5.c b/gcc/testsuite/gcc.dg/guality/pr54519-5.c
index c64527a45d9..0903fbf8946 100644
--- a/gcc/testsuite/gcc.dg/guality/pr54519-5.c
+++ b/gcc/testsuite/gcc.dg/guality/pr54519-5.c
@@ -13,13 +13,13 @@ fn2 (int x, int y)
 {
   if (y)
     {
-      fn1 (x);		/* { dg-final { gdb-test 17 "x" "6" } } */
-      fn1 (x);		/* { dg-final { gdb-test 17 "y" "25" } } */
+      fn1 (x);		/* { dg-final { gdb-test .+1 "x" "6" } } */
+      fn1 (x);		/* { dg-final { gdb-test . "y" "25" } } */
       fn1 (x);
       fn1 (x);
       y = -2 + x;
       y = y * y * y + y;
-      fn1 (x + y);	/* { dg-final { gdb-test 22 "y" "68" } } */
+      fn1 (x + y);	/* { dg-final { gdb-test . "y" "68" } } */
     }
   return x;
 }
diff --git a/gcc/testsuite/gcc.dg/guality/pr54519-6.c b/gcc/testsuite/gcc.dg/guality/pr54519-6.c
index 836ab1f6601..bb3fb5f995e 100644
--- a/gcc/testsuite/gcc.dg/guality/pr54519-6.c
+++ b/gcc/testsuite/gcc.dg/guality/pr54519-6.c
@@ -7,8 +7,8 @@
 static inline void
 f1 (int x, int y)
 {
-  asm volatile (NOP);	/* { dg-final { gdb-test 11 "x" "2" } } */
-  asm volatile (NOP);	/* { dg-final { gdb-test 11 "y" "0" } } */
+  asm volatile (NOP);	/* { dg-final { gdb-test .+1 "x" "2" } } */
+  asm volatile (NOP);	/* { dg-final { gdb-test . "y" "0" } } */
 }
 
 static inline void
diff --git a/gcc/testsuite/gcc.dg/guality/pr54551.c b/gcc/testsuite/gcc.dg/guality/pr54551.c
index 4235f78ce73..75f9c2a7e1d 100644
--- a/gcc/testsuite/gcc.dg/guality/pr54551.c
+++ b/gcc/testsuite/gcc.dg/guality/pr54551.c
@@ -14,8 +14,8 @@ foo (int x, int y, int z)
   if (x != z)
     {
       int a = z + 1;
-      bar (); /* { dg-final { gdb-test 18 "a" "4" } } */
-      bar (); /* { dg-final { gdb-test 18 "z" "3" } } */
+      bar (); /* { dg-final { gdb-test .+1 "a" "4" } } */
+      bar (); /* { dg-final { gdb-test . "z" "3" } } */
     }
   return y;
 }
diff --git a/gcc/testsuite/gcc.dg/guality/pr54693-2.c b/gcc/testsuite/gcc.dg/guality/pr54693-2.c
index 2810a75d5ec..1741a383f59 100644
--- a/gcc/testsuite/gcc.dg/guality/pr54693-2.c
+++ b/gcc/testsuite/gcc.dg/guality/pr54693-2.c
@@ -16,10 +16,10 @@ foo (int x, int y, int z)
 {
   int i = 0;
   while (x > 3 && y > 3 && z > 3)
-    {		/* { dg-final { gdb-test 21 "i" "v + 1" } } */
-		/* { dg-final { gdb-test 21 "x" "10 - i" } } */
-      bar (i);	/* { dg-final { gdb-test 21 "y" "20 - 2 * i" } } */
-		/* { dg-final { gdb-test 21 "z" "30 - 3 * i" } } */
+    {		/* { dg-final { gdb-test .+2 "i" "v + 1" } } */
+		/* { dg-final { gdb-test .+1 "x" "10 - i" } } */
+      bar (i);	/* { dg-final { gdb-test . "y" "20 - 2 * i" } } */
+		/* { dg-final { gdb-test .-1 "z" "30 - 3 * i" } } */
       i++, x--, y -= 2, z -= 3;
     }
 }
diff --git a/gcc/testsuite/gcc.dg/guality/pr54693.c b/gcc/testsuite/gcc.dg/guality/pr54693.c
index b852c06abbc..a7f7a66f79d 100644
--- a/gcc/testsuite/gcc.dg/guality/pr54693.c
+++ b/gcc/testsuite/gcc.dg/guality/pr54693.c
@@ -19,7 +19,7 @@ main ()
   for (i = 0; i < 10; i++)
     {
       c = 0x30 + i;
-      foo (&arr[i], c); /* { dg-final { gdb-test 22 "i" "c - 48" } } */
+      foo (&arr[i], c); /* { dg-final { gdb-test . "i" "c - 48" } } */
     }
   arr[10] = 0;
 
diff --git a/gcc/testsuite/gcc.dg/guality/pr54796.c b/gcc/testsuite/gcc.dg/guality/pr54796.c
index f58e5a02cc6..527a1de183b 100644
--- a/gcc/testsuite/gcc.dg/guality/pr54796.c
+++ b/gcc/testsuite/gcc.dg/guality/pr54796.c
@@ -12,9 +12,9 @@ __attribute__((noinline, noclone)) void
 foo (int a, int b)
 {
   int c = a;
-  char d[b];	/* { dg-final { gdb-test 17 "a" "5" } } */
-  bar (d, 2);	/* { dg-final { gdb-test 17 "b" "6" } } */
-  bar (d, 4);	/* { dg-final { gdb-test 17 "c" "5" } } */
+  char d[b];	/* { dg-final { gdb-test .+2 "a" "5" } } */
+  bar (d, 2);	/* { dg-final { gdb-test .+1 "b" "6" } } */
+  bar (d, 4);	/* { dg-final { gdb-test . "c" "5" } } */
 }
 
 int
diff --git a/gcc/testsuite/gcc.dg/guality/pr54970.c b/gcc/testsuite/gcc.dg/guality/pr54970.c
index 1819d023e21..5d32af07c32 100644
--- a/gcc/testsuite/gcc.dg/guality/pr54970.c
+++ b/gcc/testsuite/gcc.dg/guality/pr54970.c
@@ -8,40 +8,40 @@
 int
 main ()
 {
-  int a[] = { 1, 2, 3 };	/* { dg-final { gdb-test 15 "a\[0\]" "1" } } */
-  int *p = a + 2;		/* { dg-final { gdb-test 15 "a\[1\]" "2" } } */
-  int *q = a + 1;		/* { dg-final { gdb-test 15 "a\[2\]" "3" } } */
-				/* { dg-final { gdb-test 15 "*p" "3" } } */
-  asm volatile (NOP);		/* { dg-final { gdb-test 15 "*q" "2" } } */
-  *p += 10;			/* { dg-final { gdb-test 20 "a\[0\]" "1" } } */
-				/* { dg-final { gdb-test 20 "a\[1\]" "2" } } */
-				/* { dg-final { gdb-test 20 "a\[2\]" "13" } } */
-				/* { dg-final { gdb-test 20 "*p" "13" } } */
-  asm volatile (NOP);		/* { dg-final { gdb-test 20 "*q" "2" } } */
-  *q += 10;			/* { dg-final { gdb-test 25 "a\[0\]" "1" } } */
-				/* { dg-final { gdb-test 25 "a\[1\]" "12" } } */
-				/* { dg-final { gdb-test 25 "a\[2\]" "13" } } */
-				/* { dg-final { gdb-test 25 "*p" "13" } } */
-  asm volatile (NOP);		/* { dg-final { gdb-test 25 "*q" "12" } } */
+  int a[] = { 1, 2, 3 };	/* { dg-final { gdb-test .+4 "a\[0\]" "1" } } */
+  int *p = a + 2;		/* { dg-final { gdb-test .+3 "a\[1\]" "2" } } */
+  int *q = a + 1;		/* { dg-final { gdb-test .+2 "a\[2\]" "3" } } */
+				/* { dg-final { gdb-test .+1 "*p" "3" } } */
+  asm volatile (NOP);		/* { dg-final { gdb-test . "*q" "2" } } */
+  *p += 10;			/* { dg-final { gdb-test .+4 "a\[0\]" "1" } } */
+				/* { dg-final { gdb-test .+3 "a\[1\]" "2" } } */
+				/* { dg-final { gdb-test .+2 "a\[2\]" "13" } } */
+				/* { dg-final { gdb-test .+1 "*p" "13" } } */
+  asm volatile (NOP);		/* { dg-final { gdb-test . "*q" "2" } } */
+  *q += 10;			/* { dg-final { gdb-test .+4 "a\[0\]" "1" } } */
+				/* { dg-final { gdb-test .+3 "a\[1\]" "12" } } */
+				/* { dg-final { gdb-test .+2 "a\[2\]" "13" } } */
+				/* { dg-final { gdb-test .+1 "*p" "13" } } */
+  asm volatile (NOP);		/* { dg-final { gdb-test . "*q" "12" } } */
   __builtin_memcpy (&a, (int [3]) { 4, 5, 6 }, sizeof (a));
-				/* { dg-final { gdb-test 31 "a\[0\]" "4" { xfail { *-*-* } } } } */
-				/* { dg-final { gdb-test 31 "a\[1\]" "5" } } */
-				/* { dg-final { gdb-test 31 "a\[2\]" "6" } } */
-				/* { dg-final { gdb-test 31 "*p" "6" } } */
-  asm volatile (NOP);		/* { dg-final { gdb-test 31 "*q" "5" } } */
-  *p += 20;			/* { dg-final { gdb-test 36 "a\[0\]" "4" { xfail { *-*-* } } } } */
-				/* { dg-final { gdb-test 36 "a\[1\]" "5" } } */
-				/* { dg-final { gdb-test 36 "a\[2\]" "26" } } */
-				/* { dg-final { gdb-test 36 "*p" "26" } } */
-  asm volatile (NOP);		/* { dg-final { gdb-test 36 "*q" "5" } } */
-  *q += 20;			/* { dg-final { gdb-test 45 "a\[0\]" "4" { xfail { *-*-* } } } } */
-				/* { dg-final { gdb-test 45 "a\[1\]" "25" } } */
-				/* { dg-final { gdb-test 45 "a\[2\]" "26" } } */
-				/* { dg-final { gdb-test 45 "*p" "26" } } */
-				/* { dg-final { gdb-test 45 "p\[-1\]" "25" } } */
-				/* { dg-final { gdb-test 45 "p\[-2\]" "4" { xfail { *-*-* } } } } */
-				/* { dg-final { gdb-test 45 "q\[-1\]" "4" { xfail { *-*-* } } } } */
-				/* { dg-final { gdb-test 45 "q\[1\]" "26" } } */
-  asm volatile (NOP);		/* { dg-final { gdb-test 45 "*q" "25" } } */
+				/* { dg-final { gdb-test .+4 "a\[0\]" "4" { xfail { *-*-* } } } } */
+				/* { dg-final { gdb-test .+3 "a\[1\]" "5" } } */
+				/* { dg-final { gdb-test .+2 "a\[2\]" "6" } } */
+				/* { dg-final { gdb-test .+1 "*p" "6" } } */
+  asm volatile (NOP);		/* { dg-final { gdb-test . "*q" "5" } } */
+  *p += 20;			/* { dg-final { gdb-test .+4 "a\[0\]" "4" { xfail { *-*-* } } } } */
+				/* { dg-final { gdb-test .+3 "a\[1\]" "5" } } */
+				/* { dg-final { gdb-test .+2 "a\[2\]" "26" } } */
+				/* { dg-final { gdb-test .+1 "*p" "26" } } */
+  asm volatile (NOP);		/* { dg-final { gdb-test . "*q" "5" } } */
+  *q += 20;			/* { dg-final { gdb-test .+8 "a\[0\]" "4" { xfail { *-*-* } } } } */
+				/* { dg-final { gdb-test .+7 "a\[1\]" "25" } } */
+				/* { dg-final { gdb-test .+6 "a\[2\]" "26" } } */
+				/* { dg-final { gdb-test .+5 "*p" "26" } } */
+				/* { dg-final { gdb-test .+4 "p\[-1\]" "25" } } */
+				/* { dg-final { gdb-test .+3 "p\[-2\]" "4" { xfail { *-*-* } } } } */
+				/* { dg-final { gdb-test .+2 "q\[-1\]" "4" { xfail { *-*-* } } } } */
+				/* { dg-final { gdb-test .+1 "q\[1\]" "26" } } */
+  asm volatile (NOP);		/* { dg-final { gdb-test . "*q" "25" } } */
   return 0;
 }
diff --git a/gcc/testsuite/gcc.dg/guality/pr67192.c b/gcc/testsuite/gcc.dg/guality/pr67192.c
index 946e68f8faa..6ed0b7e0cee 100644
--- a/gcc/testsuite/gcc.dg/guality/pr67192.c
+++ b/gcc/testsuite/gcc.dg/guality/pr67192.c
@@ -24,7 +24,7 @@ f1 (void)
       if (last ())
 	break;
     }
-  do_it (); /* { dg-final { gdb-test 27 "cnt" "5" } } */
+  do_it (); /* { dg-final { gdb-test . "cnt" "5" } } */
 }
 
 __attribute__((noinline, noclone)) static void
@@ -36,7 +36,7 @@ f2 (void)
 	break;
       do_it ();
     }
-  do_it (); /* { dg-final { gdb-test 39 "cnt" "10" } } */
+  do_it (); /* { dg-final { gdb-test . "cnt" "10" } } */
 }
 
 __attribute__((noinline, noclone)) static void
@@ -45,18 +45,18 @@ f3 (void)
   for (;; do_it())
     if (last ())
       break;
-  do_it (); /* { dg-final { gdb-test 48 "cnt" "15" } } */
+  do_it (); /* { dg-final { gdb-test . "cnt" "15" } } */
 }
 
 __attribute__((noinline, noclone)) static void
 f4 (void)
 {
-  while (1) /* { dg-final { gdb-test 54 "cnt" "15" } } */
+  while (1) /* { dg-final { gdb-test . "cnt" "15" } } */
     if (last ())
       break;
     else
       do_it ();
-  do_it (); /* { dg-final { gdb-test 59 "cnt" "20" } } */
+  do_it (); /* { dg-final { gdb-test . "cnt" "20" } } */
 }
 
 void (*volatile fnp1) (void) = f1;
diff --git a/gcc/testsuite/gcc.dg/guality/pr69947.c b/gcc/testsuite/gcc.dg/guality/pr69947.c
index 6280ed5754c..163214972f5 100644
--- a/gcc/testsuite/gcc.dg/guality/pr69947.c
+++ b/gcc/testsuite/gcc.dg/guality/pr69947.c
@@ -10,8 +10,8 @@ __attribute__((noinline, noclone)) void
 foo (void)
 {
   static const char a[] = "abcdefg";
-  const char *b = a;		/* { dg-final { gdb-test 14 "c\[2\]" "'o'" } } */
-  asm (NOP : : : "memory");	/* { dg-final { gdb-test 14 "b\[4\]" "'e'" } } */
+  const char *b = a;		/* { dg-final { gdb-test .+1 "c\[2\]" "'o'" } } */
+  asm (NOP : : : "memory");	/* { dg-final { gdb-test . "b\[4\]" "'e'" } } */
 }
 
 int
diff --git a/gcc/testsuite/gcc.dg/guality/pr78726.c b/gcc/testsuite/gcc.dg/guality/pr78726.c
index dc6b386be1d..428b4122fe9 100644
--- a/gcc/testsuite/gcc.dg/guality/pr78726.c
+++ b/gcc/testsuite/gcc.dg/guality/pr78726.c
@@ -15,9 +15,9 @@ foo (void)
   unsigned d2 = d1 * c;		/* { dg-final { gdb-test 21 "d2" "~36U * 173 * 173" } } */
   unsigned d3 = 1023094746 * a;	/* { dg-final { gdb-test 21 "d3" "~36U * 1023094746" } } */
   d = d2 + d3;
-  unsigned d4 = d1 * 2;     	/* { dg-final { gdb-test 21 "d4" "~36U * 173 * 2" } } */
-  unsigned d5 = d2 * 2;		/* { dg-final { gdb-test 21 "d5" "~36U * 173 * 173 * 2" } } */
-  unsigned d6 = d3 * 2;		/* { dg-final { gdb-test 21 "d6" "~36U * 1023094746 * 2" } } */
+  unsigned d4 = d1 * 2;     	/* { dg-final { gdb-test .+3 "d4" "~36U * 173 * 2" } } */
+  unsigned d5 = d2 * 2;		/* { dg-final { gdb-test .+2 "d5" "~36U * 173 * 173 * 2" } } */
+  unsigned d6 = d3 * 2;		/* { dg-final { gdb-test .+1 "d6" "~36U * 1023094746 * 2" } } */
   asm (NOP : : : "memory");
 }
 
diff --git a/gcc/testsuite/gcc.dg/guality/rotatetest.c b/gcc/testsuite/gcc.dg/guality/rotatetest.c
index d44c2807a42..d2b4acbdb75 100644
--- a/gcc/testsuite/gcc.dg/guality/rotatetest.c
+++ b/gcc/testsuite/gcc.dg/guality/rotatetest.c
@@ -9,7 +9,7 @@ f1 (unsigned long x)
   long f = (x << 12) | (x >> (64 - 12));
   long g = f;
   asm volatile ("" : "+r" (f));
-  vv++;		/* { dg-final { gdb-test 12 "g" "f" } } */
+  vv++;		/* { dg-final { gdb-test . "g" "f" } } */
   return f;
 }
 
@@ -19,7 +19,7 @@ f2 (unsigned long x, int y)
   long f = (x << y) | (x >> (64 - y));
   long g = f;
   asm volatile ("" : "+r" (f));
-  vv++;		/* { dg-final { gdb-test 22 "g" "f" } } */
+  vv++;		/* { dg-final { gdb-test . "g" "f" } } */
   return f;
 }
 
@@ -29,7 +29,7 @@ f3 (unsigned long x, int y)
   long f = (x >> y) | (x << (64 - y));
   long g = f;
   asm volatile ("" : "+r" (f));
-  vv++;		/* { dg-final { gdb-test 32 "g" "f" } } */
+  vv++;		/* { dg-final { gdb-test . "g" "f" } } */
   return f;
 }
 
@@ -39,7 +39,7 @@ f4 (unsigned int x)
   unsigned int f = (x << 12) | (x >> (32 - 12));
   unsigned int g = f;
   asm volatile ("" : "+r" (f));
-  vv++;		/* { dg-final { gdb-test 42 "g" "f" } } */
+  vv++;		/* { dg-final { gdb-test . "g" "f" } } */
   return f;
 }
 
@@ -49,7 +49,7 @@ f5 (unsigned int x, int y)
   unsigned int f = (x << y) | (x >> (32 - y));
   unsigned int g = f;
   asm volatile ("" : "+r" (f));
-  vv++;		/* { dg-final { gdb-test 52 "g" "f" } } */
+  vv++;		/* { dg-final { gdb-test . "g" "f" } } */
   return f;
 }
 
@@ -59,7 +59,7 @@ f6 (unsigned int x, int y)
   unsigned int f = (x >> y) | (x << (32 - y));
   unsigned int g = f;
   asm volatile ("" : "+r" (f));
-  vv++;		/* { dg-final { gdb-test 62 "g" "f" } } */
+  vv++;		/* { dg-final { gdb-test . "g" "f" } } */
   return f;
 }
 
diff --git a/gcc/testsuite/gcc.dg/guality/sra-1.c b/gcc/testsuite/gcc.dg/guality/sra-1.c
index e779d7ac8ff..a747bc302aa 100644
--- a/gcc/testsuite/gcc.dg/guality/sra-1.c
+++ b/gcc/testsuite/gcc.dg/guality/sra-1.c
@@ -17,8 +17,8 @@ f1 (int k)
   struct A a = { 4, k + 6 };
   asm ("" : "+r" (a.i));
   a.j++;
-  bar (a.i);		/* { dg-final { gdb-test 21 "a.i" "4" } } */
-  bar (a.j);		/* { dg-final { gdb-test 21 "a.j" "14" } } */
+  bar (a.i);		/* { dg-final { gdb-test .+1 "a.i" "4" } } */
+  bar (a.j);		/* { dg-final { gdb-test . "a.j" "14" } } */
   return a.i + a.j;
 }
 
@@ -28,8 +28,8 @@ f2 (int k)
   int a[2] = { 4, k + 6 };
   asm ("" : "+r" (a[0]));
   a[1]++;
-  bar (a[0]);		/* { dg-final { gdb-test 32 "a\[0\]" "4" } } */
-  bar (a[1]);		/* { dg-final { gdb-test 32 "a\[1\]" "14" } } */
+  bar (a[0]);		/* { dg-final { gdb-test .+1 "a\[0\]" "4" } } */
+  bar (a[1]);		/* { dg-final { gdb-test . "a\[1\]" "14" } } */
   return a[0] + a[1];
 }
 
@@ -39,8 +39,8 @@ f3 (int k)
   struct B a = { 4, k + 6 };
   asm ("" : "+r" (a.i));
   a.j++;
-  bar (a.i);		/* { dg-final { gdb-test 43 "a.i" "4" } } */
-  bar (a.j);		/* { dg-final { gdb-test 43 "a.j" "14" } } */
+  bar (a.i);		/* { dg-final { gdb-test .+1 "a.i" "4" } } */
+  bar (a.j);		/* { dg-final { gdb-test . "a.j" "14" } } */
   return a.i + a.j;
 }
 
diff --git a/gcc/testsuite/gcc.dg/guality/vla-2.c b/gcc/testsuite/gcc.dg/guality/vla-2.c
index 6773775b9d2..ab30e0ac9db 100644
--- a/gcc/testsuite/gcc.dg/guality/vla-2.c
+++ b/gcc/testsuite/gcc.dg/guality/vla-2.c
@@ -13,7 +13,7 @@ fn2 (int i)
 {
   int a[i];
   fn1 (a, i);
-  fn1 (a, i);		/* { dg-final { gdb-test 16 "sizeof (a)" "5 * sizeof (int)" } } */
+  fn1 (a, i);		/* { dg-final { gdb-test . "sizeof (a)" "5 * sizeof (int)" } } */
   return i;
 }
 
@@ -22,7 +22,7 @@ fn3 (int i)
 {
   int a[i];
   fn1 (a, i);
-  fn1 (a, i);		/* { dg-final { gdb-test 25 "sizeof (a)" "6 * sizeof (int)" } } */
+  fn1 (a, i);		/* { dg-final { gdb-test . "sizeof (a)" "6 * sizeof (int)" } } */
   return i;
 }
 
