[PATCH] testsuite: fix problem with double-escaping in patterns

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Since the patterns in the testcases are evaluated in the shell
script, the backslash used to escape characters special to the
pattern need itself to be escaped. There are a few cases where
it wasn't done so, partly because 'format -l' gave a single
escape in its template.

Fix all occurences neededing this double-escape as well as the
'format -l' template.

Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@xxxxxxxxx>
---
 validation/c11-alignas.c                  | 2 +-
 validation/c11-alignof.c                  | 2 +-
 validation/linear/bitfield-expand-deref.c | 4 ++--
 validation/linear/call-builtin.c          | 2 +-
 validation/linear/call-casted-pointer.c   | 4 ++--
 validation/linear/call-direct.c           | 2 +-
 validation/linear/call-indirect.c         | 2 +-
 validation/linear/call-inline.c           | 2 +-
 validation/linear/deref-ptr-ptr.c         | 4 ++--
 validation/linear/unexamined-base-type.c  | 2 +-
 validation/mem2reg/killed-insn.c          | 2 +-
 validation/optim/call-complex-pointer.c   | 4 ++--
 validation/optim/canonical-add.c          | 4 ++--
 validation/optim/canonical-cmp.c          | 2 +-
 validation/optim/canonical-fcmp.c         | 2 +-
 validation/optim/canonical-mul.c          | 6 +++---
 validation/optim/load-converted.c         | 2 +-
 validation/optim/store-dominated.c        | 2 +-
 validation/test-suite                     | 8 ++++----
 19 files changed, 29 insertions(+), 29 deletions(-)

diff --git a/validation/c11-alignas.c b/validation/c11-alignas.c
index 4b264a5dc..b7ae2abc3 100644
--- a/validation/c11-alignas.c
+++ b/validation/c11-alignas.c
@@ -36,5 +36,5 @@ c11-alignas.c:10:17: error: Syntax error in unary expression
  * check-error-end
  *
  * check-output-ignore
- * check-output-contains: ret\\.32 *\$0
+ * check-output-contains: ret\\.32 *\\$0
  */
diff --git a/validation/c11-alignof.c b/validation/c11-alignof.c
index 238ef9941..83c0e70d9 100644
--- a/validation/c11-alignof.c
+++ b/validation/c11-alignof.c
@@ -8,5 +8,5 @@ static int foo(void)
  * check-command: test-linearize -std=c11 $file
  *
  * check-output-ignore
- * check-output-contains: ret\\.32 *\$2
+ * check-output-contains: ret\\.32 *\\$2
  */
diff --git a/validation/linear/bitfield-expand-deref.c b/validation/linear/bitfield-expand-deref.c
index 7748725fc..43e1078d5 100644
--- a/validation/linear/bitfield-expand-deref.c
+++ b/validation/linear/bitfield-expand-deref.c
@@ -22,6 +22,6 @@ int bar(int a)
  * check-command: test-linearize -Wno-decl $file
  *
  * check-output-ignore
- * check-output-excludes: ret\..*\$12
- * check-output-contains: ret\..*\$34
+ * check-output-excludes: ret\\..*\\$12
+ * check-output-contains: ret\\..*\\$34
  */
diff --git a/validation/linear/call-builtin.c b/validation/linear/call-builtin.c
index b15113593..43e254f6d 100644
--- a/validation/linear/call-builtin.c
+++ b/validation/linear/call-builtin.c
@@ -13,5 +13,5 @@ u32 f3(u32 a) { return (***__builtin_popcount)(a); }	// C99,C11 6.5.3.2p4
  *
  * check-output-ignore
  * check-output-excludes: load
- * check-output-pattern(5): call\..*__builtin_.*, %arg1
+ * check-output-pattern(5): call\\..*__builtin_.*, %arg1
  */
diff --git a/validation/linear/call-casted-pointer.c b/validation/linear/call-casted-pointer.c
index 610d67482..60f536052 100644
--- a/validation/linear/call-casted-pointer.c
+++ b/validation/linear/call-casted-pointer.c
@@ -26,6 +26,6 @@ int quz(void *a, void *fun)
  *
  * check-output-ignore
  * check-output-excludes: load
- * check-output-pattern(4): ptrcast\..* %arg2
- * check-output-pattern(4): call\..* %arg1
+ * check-output-pattern(4): ptrcast\\..* %arg2
+ * check-output-pattern(4): call\\..* %arg1
  */
diff --git a/validation/linear/call-direct.c b/validation/linear/call-direct.c
index 52f86306b..c3761cc5f 100644
--- a/validation/linear/call-direct.c
+++ b/validation/linear/call-direct.c
@@ -13,5 +13,5 @@ int f3(void) { return (***fun)(); }	// C99,C11 6.5.3.2p4
  *
  * check-output-ignore
  * check-output-excludes: load
- * check-output-pattern(5): call\..* fun
+ * check-output-pattern(5): call\\..* fun
  */
diff --git a/validation/linear/call-indirect.c b/validation/linear/call-indirect.c
index 1275910c4..400855685 100644
--- a/validation/linear/call-indirect.c
+++ b/validation/linear/call-indirect.c
@@ -11,5 +11,5 @@ int g3(int (*fun)(void)) { return (***fun)(); }	// C99,C11 6.5.3.2p4
  *
  * check-output-ignore
  * check-output-excludes: load
- * check-output-pattern(5): call\..* %arg1
+ * check-output-pattern(5): call\\..* %arg1
  */
diff --git a/validation/linear/call-inline.c b/validation/linear/call-inline.c
index a33f0a1c8..dfd49b62c 100644
--- a/validation/linear/call-inline.c
+++ b/validation/linear/call-inline.c
@@ -14,5 +14,5 @@ int i3(void) { return (***fun)(); }		// C99,C11 6.5.3.2p4
  * check-output-ignore
  * check-output-excludes: load
  * check-output-excludes: call
- * check-output-pattern(5): ret\..* \\$42
+ * check-output-pattern(5): ret\\..* \\$42
  */
diff --git a/validation/linear/deref-ptr-ptr.c b/validation/linear/deref-ptr-ptr.c
index 963acd36c..531d36370 100644
--- a/validation/linear/deref-ptr-ptr.c
+++ b/validation/linear/deref-ptr-ptr.c
@@ -8,9 +8,9 @@ char *foo(char **pfmt)
  * check-command: test-linearize -m64 -Wno-decl $file
  *
  * check-output-excludes: load[^.]
- * check-output-contains: load\.
+ * check-output-contains: load\\.
  * check-output-excludes: store[^.]
- * check-output-contains: store\.
+ * check-output-contains: store\\.
  *
  * check-output-start
 foo:
diff --git a/validation/linear/unexamined-base-type.c b/validation/linear/unexamined-base-type.c
index 96aee3f0e..142139a2e 100644
--- a/validation/linear/unexamined-base-type.c
+++ b/validation/linear/unexamined-base-type.c
@@ -31,6 +31,6 @@ static void bar(struct s *d, struct s *s1, struct s *s2)
  *
  * check-output-ignore
  * check-output-excludes: load[^.]
- * check-output-excludes: cast\..*(0)
+ * check-output-excludes: cast\\..*(0)
  * check-output-excludes: store[^.]
  */
diff --git a/validation/mem2reg/killed-insn.c b/validation/mem2reg/killed-insn.c
index 641525d3f..adbef9805 100644
--- a/validation/mem2reg/killed-insn.c
+++ b/validation/mem2reg/killed-insn.c
@@ -11,5 +11,5 @@ static void foo(void)
  * check-command: test-linearize -fdump-ir=mem2reg $file
  *
  * check-output-ignore
- * check-output-excludes: store\.
+ * check-output-excludes: store\\.
  */
diff --git a/validation/optim/call-complex-pointer.c b/validation/optim/call-complex-pointer.c
index 6cfeb6abd..d1b68fb16 100644
--- a/validation/optim/call-complex-pointer.c
+++ b/validation/optim/call-complex-pointer.c
@@ -8,6 +8,6 @@ int foo(int p, int (*f0)(int), int (*f1)(int), int arg)
  * check-known-to-fail
  *
  * check-output-ignore
- * check-output-excludes: ptrcast\.
- * check-output-contains: select\.
+ * check-output-excludes: ptrcast\\.
+ * check-output-contains: select\\.
  */
diff --git a/validation/optim/canonical-add.c b/validation/optim/canonical-add.c
index b7035e4cd..6f32a61e2 100644
--- a/validation/optim/canonical-add.c
+++ b/validation/optim/canonical-add.c
@@ -50,6 +50,6 @@ int xmc_sub_ymc(int x, int y)
  * check-known-to-fail
  * check-output-ignore
 
- * check-output-excludes: \$1
- * check-output-excludes: \$-1
+ * check-output-excludes: \\$1
+ * check-output-excludes: \\$-1
  */
diff --git a/validation/optim/canonical-cmp.c b/validation/optim/canonical-cmp.c
index 6f3b5180e..0fc531e9a 100644
--- a/validation/optim/canonical-cmp.c
+++ b/validation/optim/canonical-cmp.c
@@ -21,7 +21,7 @@ uint uat(uint p, uint a) { return (123 <  p) ? a : 0; }
  * check-name: canonical-cmp
  * check-command: test-linearize -Wno-decl $file
  *
- * check-output-excludes: \$123,
+ * check-output-excludes: \\$123,
  *
  * check-output-start
 seq:
diff --git a/validation/optim/canonical-fcmp.c b/validation/optim/canonical-fcmp.c
index d098da64f..b919a55f7 100644
--- a/validation/optim/canonical-fcmp.c
+++ b/validation/optim/canonical-fcmp.c
@@ -20,7 +20,7 @@ int nfcmp_ge(double a) { return !(g <  a); }
  * check-name: canonical-cmp
  * check-command: test-linearize -Wno-decl $file
  *
- * check-output-excludes: \$123,
+ * check-output-excludes: \\$123,
  *
  * check-output-start
 fcmp_eq:
diff --git a/validation/optim/canonical-mul.c b/validation/optim/canonical-mul.c
index 90d59f2e2..3ae9e3a64 100644
--- a/validation/optim/canonical-mul.c
+++ b/validation/optim/canonical-mul.c
@@ -18,7 +18,7 @@ uint xtc_umul_ytc(uint x, uint y) { return (x * 3) * (y * 2); }
  * check-known-to-fail
  * check-output-ignore
  *
- * check-output-excludes: \$3
- * check-output-excludes: \$2
- * check-output-contains: \$6
+ * check-output-excludes: \\$3
+ * check-output-excludes: \\$2
+ * check-output-contains: \\$6
  */
diff --git a/validation/optim/load-converted.c b/validation/optim/load-converted.c
index 7cbb53cf4..91e04af4f 100644
--- a/validation/optim/load-converted.c
+++ b/validation/optim/load-converted.c
@@ -10,5 +10,5 @@ static int foo(int *p, int i)
  * check-command: test-linearize -Wno-decl $file
  *
  * check-output-ignore
- * check-output-excludes: add\.
+ * check-output-excludes: add\\.
  */
diff --git a/validation/optim/store-dominated.c b/validation/optim/store-dominated.c
index d74db7790..5780ba6b0 100644
--- a/validation/optim/store-dominated.c
+++ b/validation/optim/store-dominated.c
@@ -11,5 +11,5 @@ static void foo(void)
  * check-command: test-linearize $file
  *
  * check-output-ignore
- * check-output-excludes: add\.
+ * check-output-excludes: add\\.
  */
diff --git a/validation/test-suite b/validation/test-suite
index e1552ed46..4fdc9e9fa 100755
--- a/validation/test-suite
+++ b/validation/test-suite
@@ -490,10 +490,10 @@ _EOF
 		echo " * check-known-to-fail"
 	fi
 	if [ $linear != 0 ]; then
-		echo " *"
-		echo " * check-output-ignore"
-		echo " * check-output-contains: xyz\\\\."
-		echo " * check-output-excludes: \\\\."
+		echo ' *'
+		echo ' * check-output-ignore'
+		echo ' * check-output-contains: xyz\\\\.'
+		echo ' * check-output-excludes: \\\\.'
 	fi
 	for stream in output error; do
 		if [ -s "$file.$stream.got" ]; then
-- 
2.16.2

--
To unsubscribe from this list: send the line "unsubscribe linux-sparse" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Newbies FAQ]     [LKML]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Trinity Fuzzer Tool]

  Powered by Linux