summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristophe Lyon <christophe.lyon@linaro.org>2016-12-13 14:36:29 +0100
committerChristophe Lyon <christophe.lyon@linaro.org>2016-12-13 14:36:29 +0100
commit5f585eda11e1f1570dc705caa019b943f52225d6 (patch)
tree244f0cad88dc246caa18e3f957badedcc3a13a2c
downloadgcc-scripts-5f585eda11e1f1570dc705caa019b943f52225d6.tar.gz
Add check-dg-directives-order.sh
-rwxr-xr-xcheck-dg-directives-order.sh25
1 files changed, 25 insertions, 0 deletions
diff --git a/check-dg-directives-order.sh b/check-dg-directives-order.sh
new file mode 100755
index 0000000..4890ed1
--- /dev/null
+++ b/check-dg-directives-order.sh
@@ -0,0 +1,25 @@
+#!/bin/bash
+# This script checks dg directives order in a testsuite directory
+
+if [ $# -lt 3 ]
+then
+ echo Usage: $0 first-directive second-directive dir...
+ exit 1
+fi
+
+FIRST=$1
+SECOND=$2
+shift
+shift
+
+grep -r -n $SECOND $* | grep -v "Binary file matches" | while read line
+do
+ file=`echo $line | cut -d: -f1`
+ line=`echo $line | cut -d: -f2`
+ linedo=`grep -n $FIRST $file | cut -d: -f1 | head -n1`
+
+ if [ x$linedo != x ] && [ $linedo -gt $line ]
+ then
+ echo Bug in $file: wrong order
+ fi
+done