[runtime] [test] Fix using %python path

Fix the newly-added tests to use %python substitution in order to use
the correct path to Python interpreter.  Otherwise, they fail on NetBSD
where there is no 'python', just 'pythonX.Y'.

Differential Revision: https://reviews.llvm.org/D56048

git-svn-id: https://llvm.org/svn/llvm-project/openmp/trunk@350001 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/runtime/test/affinity/format/affinity_display.1.c b/runtime/test/affinity/format/affinity_display.1.c
index b900c3c..fe357d3 100644
--- a/runtime/test/affinity/format/affinity_display.1.c
+++ b/runtime/test/affinity/format/affinity_display.1.c
@@ -1,5 +1,5 @@
 // RUN: %libomp-compile
-// RUN: env OMP_DISPLAY_AFFINITY=TRUE OMP_NUM_THREADS=4 OMP_PLACES='{0,1},{2,3},{4,5},{6,7}' %libomp-run | python %S/check.py -c 'CHECK' %s
+// RUN: env OMP_DISPLAY_AFFINITY=TRUE OMP_NUM_THREADS=4 OMP_PLACES='{0,1},{2,3},{4,5},{6,7}' %libomp-run | %python %S/check.py -c 'CHECK' %s
 
 // Affinity Display examples
 #include <stdio.h>
diff --git a/runtime/test/affinity/format/api.c b/runtime/test/affinity/format/api.c
index df6be66..08805e7 100644
--- a/runtime/test/affinity/format/api.c
+++ b/runtime/test/affinity/format/api.c
@@ -1,5 +1,5 @@
 // RUN: %libomp-compile-and-run
-// RUN: %libomp-run | python %S/check.py -c 'CHECK' %s
+// RUN: %libomp-run | %python %S/check.py -c 'CHECK' %s
 
 #include <stdio.h>
 #include <stdlib.h>
diff --git a/runtime/test/affinity/format/api2.c b/runtime/test/affinity/format/api2.c
index 7b2d700..c32da93 100644
--- a/runtime/test/affinity/format/api2.c
+++ b/runtime/test/affinity/format/api2.c
@@ -1,5 +1,5 @@
 // RUN: %libomp-compile-and-run
-// RUN: %libomp-run | python %S/check.py -c 'CHECK' %s
+// RUN: %libomp-run | %python %S/check.py -c 'CHECK' %s
 
 #include <stdio.h>
 #include <stdlib.h>
diff --git a/runtime/test/affinity/format/increase.c b/runtime/test/affinity/format/increase.c
index 46d8edb..b3942db 100644
--- a/runtime/test/affinity/format/increase.c
+++ b/runtime/test/affinity/format/increase.c
@@ -1,4 +1,4 @@
-// RUN: %libomp-compile && env OMP_DISPLAY_AFFINITY=true %libomp-run | python %S/check.py -c 'CHECK' %s
+// RUN: %libomp-compile && env OMP_DISPLAY_AFFINITY=true %libomp-run | %python %S/check.py -c 'CHECK' %s
 
 #include <stdio.h>
 #include <stdlib.h>
diff --git a/runtime/test/affinity/format/nested.c b/runtime/test/affinity/format/nested.c
index 502c1da..2ecc918 100644
--- a/runtime/test/affinity/format/nested.c
+++ b/runtime/test/affinity/format/nested.c
@@ -1,4 +1,4 @@
-// RUN: %libomp-compile && env OMP_DISPLAY_AFFINITY=true OMP_PLACES=threads OMP_PROC_BIND=spread,close %libomp-run | python %S/check.py -c 'CHECK' %s
+// RUN: %libomp-compile && env OMP_DISPLAY_AFFINITY=true OMP_PLACES=threads OMP_PROC_BIND=spread,close %libomp-run | %python %S/check.py -c 'CHECK' %s
 // REQUIRES: affinity
 
 #include <stdio.h>
diff --git a/runtime/test/affinity/format/nested2.c b/runtime/test/affinity/format/nested2.c
index 3dd4956..4b54912 100644
--- a/runtime/test/affinity/format/nested2.c
+++ b/runtime/test/affinity/format/nested2.c
@@ -1,4 +1,4 @@
-// RUN: %libomp-compile && env OMP_DISPLAY_AFFINITY=true OMP_PLACES=threads OMP_PROC_BIND=spread,close KMP_HOT_TEAMS_MAX_LEVEL=2 %libomp-run | python %S/check.py -c 'CHECK' %s
+// RUN: %libomp-compile && env OMP_DISPLAY_AFFINITY=true OMP_PLACES=threads OMP_PROC_BIND=spread,close KMP_HOT_TEAMS_MAX_LEVEL=2 %libomp-run | %python %S/check.py -c 'CHECK' %s
 
 #include <stdio.h>
 #include <stdlib.h>
diff --git a/runtime/test/affinity/format/nested_mixed.c b/runtime/test/affinity/format/nested_mixed.c
index a39b4fd..1e4c753 100644
--- a/runtime/test/affinity/format/nested_mixed.c
+++ b/runtime/test/affinity/format/nested_mixed.c
@@ -1,4 +1,4 @@
-// RUN: %libomp-compile && env OMP_DISPLAY_AFFINITY=true %libomp-run | python %S/check.py -c 'CHECK' %s
+// RUN: %libomp-compile && env OMP_DISPLAY_AFFINITY=true %libomp-run | %python %S/check.py -c 'CHECK' %s
 
 #include <stdio.h>
 #include <stdlib.h>
diff --git a/runtime/test/affinity/format/nested_serial.c b/runtime/test/affinity/format/nested_serial.c
index 87ff2bd..8b84ba6 100644
--- a/runtime/test/affinity/format/nested_serial.c
+++ b/runtime/test/affinity/format/nested_serial.c
@@ -1,4 +1,4 @@
-// RUN: %libomp-compile && env OMP_DISPLAY_AFFINITY=true %libomp-run | python %S/check.py -c 'CHECK' %s
+// RUN: %libomp-compile && env OMP_DISPLAY_AFFINITY=true %libomp-run | %python %S/check.py -c 'CHECK' %s
 
 #include <stdio.h>
 #include <stdlib.h>
diff --git a/runtime/test/affinity/format/proc_bind.c b/runtime/test/affinity/format/proc_bind.c
index e88e1aa..765c3ce 100644
--- a/runtime/test/affinity/format/proc_bind.c
+++ b/runtime/test/affinity/format/proc_bind.c
@@ -1,4 +1,4 @@
-// RUN: %libomp-compile && env OMP_DISPLAY_AFFINITY=true OMP_PLACES='{0},{0,1},{0},{0,1},{0},{0,1},{0},{0,1},{0},{0,1},{0}' %libomp-run | python %S/check.py -c 'CHECK' %s
+// RUN: %libomp-compile && env OMP_DISPLAY_AFFINITY=true OMP_PLACES='{0},{0,1},{0},{0,1},{0},{0,1},{0},{0,1},{0},{0,1},{0}' %libomp-run | %python %S/check.py -c 'CHECK' %s
 // REQUIRES: affinity
 
 #include <stdio.h>
diff --git a/runtime/test/affinity/format/simple.c b/runtime/test/affinity/format/simple.c
index 954aa74..701c207 100644
--- a/runtime/test/affinity/format/simple.c
+++ b/runtime/test/affinity/format/simple.c
@@ -1,10 +1,10 @@
 // RUN: %libomp-compile
-// RUN: env OMP_DISPLAY_AFFINITY=false %libomp-run | python %S/check.py -c 'NOTHING' %s
-// RUN: env OMP_DISPLAY_AFFINITY=true OMP_NUM_THREADS=1 %libomp-run | python %S/check.py -c 'CHECK' %s
-// RUN: env OMP_DISPLAY_AFFINITY=true OMP_NUM_THREADS=2 %libomp-run | python %S/check.py -c 'CHECK-2' %s
-// RUN: env OMP_DISPLAY_AFFINITY=true OMP_NUM_THREADS=3 %libomp-run | python %S/check.py -c 'CHECK-3' %s
-// RUN: env OMP_DISPLAY_AFFINITY=true OMP_NUM_THREADS=4 %libomp-run | python %S/check.py -c 'CHECK-4' %s
-// RUN: env OMP_DISPLAY_AFFINITY=true OMP_NUM_THREADS=8 %libomp-run | python %S/check.py -c 'CHECK-8' %s
+// RUN: env OMP_DISPLAY_AFFINITY=false %libomp-run | %python %S/check.py -c 'NOTHING' %s
+// RUN: env OMP_DISPLAY_AFFINITY=true OMP_NUM_THREADS=1 %libomp-run | %python %S/check.py -c 'CHECK' %s
+// RUN: env OMP_DISPLAY_AFFINITY=true OMP_NUM_THREADS=2 %libomp-run | %python %S/check.py -c 'CHECK-2' %s
+// RUN: env OMP_DISPLAY_AFFINITY=true OMP_NUM_THREADS=3 %libomp-run | %python %S/check.py -c 'CHECK-3' %s
+// RUN: env OMP_DISPLAY_AFFINITY=true OMP_NUM_THREADS=4 %libomp-run | %python %S/check.py -c 'CHECK-4' %s
+// RUN: env OMP_DISPLAY_AFFINITY=true OMP_NUM_THREADS=8 %libomp-run | %python %S/check.py -c 'CHECK-8' %s
 
 #include <stdio.h>
 #include <stdlib.h>
diff --git a/runtime/test/affinity/format/simple_env.c b/runtime/test/affinity/format/simple_env.c
index 7aab1cf..ad0a265 100644
--- a/runtime/test/affinity/format/simple_env.c
+++ b/runtime/test/affinity/format/simple_env.c
@@ -1,5 +1,5 @@
 // RUN: %libomp-compile
-// RUN: env OMP_DISPLAY_AFFINITY=true OMP_AFFINITY_FORMAT='TESTER-ENV: tl:%L tn:%n nt:%N' OMP_NUM_THREADS=8 %libomp-run | python %S/check.py -c 'CHECK-8' %s
+// RUN: env OMP_DISPLAY_AFFINITY=true OMP_AFFINITY_FORMAT='TESTER-ENV: tl:%L tn:%n nt:%N' OMP_NUM_THREADS=8 %libomp-run | %python %S/check.py -c 'CHECK-8' %s
 
 #include <stdio.h>
 #include <stdlib.h>
diff --git a/runtime/test/lit.cfg b/runtime/test/lit.cfg
index 066929e..02abba0 100644
--- a/runtime/test/lit.cfg
+++ b/runtime/test/lit.cfg
@@ -124,6 +124,7 @@
 config.substitutions.append(("%clang", config.test_c_compiler))
 config.substitutions.append(("%openmp_flags", config.test_openmp_flags))
 config.substitutions.append(("%flags", config.test_flags))
+config.substitutions.append(("%python", '"%s"' % (sys.executable)))
 
 if config.has_ompt:
     config.substitutions.append(("FileCheck", config.test_filecheck))