Dan is right, using "string first" would produce false positives. So,
authorReid Spencer <rspencer@reidspencer.com>
Mon, 23 Apr 2007 21:21:53 +0000 (21:21 +0000)
committerReid Spencer <rspencer@reidspencer.com>
Mon, 23 Apr 2007 21:21:53 +0000 (21:21 +0000)
devolve the check to a comparison against each component in the string.
Fortunately there isn't many of them.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36376 91177308-0d34-0410-b5e6-96231b3b80d8

test/lib/llvm.exp

index e7245064532bf6491e53b448ed46c36f6e669a24..4fc9c4aa5e1e0c26b25607456e9eaaa6a3f5669e 100644 (file)
@@ -207,13 +207,15 @@ proc llvm_gcc_supports { lang } {
     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;
 }