[llvm-commits] CVS: llvm/test/lib/llvm.exp

Reid Spencer reid at x10sys.com
Mon Apr 23 14:22:11 PDT 2007



Changes in directory llvm/test/lib:

llvm.exp updated: 1.22 -> 1.23
---
Log message:

Dan is right, using "string first" would produce false positives. So,
devolve the check to a comparison against each component in the string. 
Fortunately there isn't many of them.


---
Diffs of the changes:  (+9 -7)

 llvm.exp |   16 +++++++++-------
 1 files changed, 9 insertions(+), 7 deletions(-)


Index: llvm/test/lib/llvm.exp
diff -u llvm/test/lib/llvm.exp:1.22 llvm/test/lib/llvm.exp:1.23
--- llvm/test/lib/llvm.exp:1.22	Sun Apr 22 09:14:11 2007
+++ llvm/test/lib/llvm.exp	Mon Apr 23 16:21:53 2007
@@ -207,13 +207,15 @@
     fortran { set file fcc1 }
     default { return 0 }
   }
-  if { [ string first "$lang" "$llvmgcc_langs" ] >= 0 } {
-    # FIXME: Knowing it is configured is not enough. We should do two more
-    # checks here. First, we need to run llvm-gcc -print-prog-name=$file to get
-    # the path to the compiler. If we don't get a path, the language isn't
-    # properly configured or built. If we do get a path, we should check to make
-    # sure that it is executable and perhaps even try executing it.
-    return 1;
+  foreach supported_lang [split "$llvmgcc_langs" ,] {
+    if { "$lang" == "$supported_lang" } {
+      # FIXME: Knowing it is configured is not enough. We should do two more
+      # checks here. First, we need to run llvm-gcc -print-prog-name=$file to 
+      # get the path to the compiler. If we don't get a path, the language isn't
+      # properly configured or built. If we do get a path, we should check to 
+      # make sure that it is executable and perhaps even try executing it.
+      return 1;
+    }
   }
   return 0;
 }






More information about the llvm-commits mailing list