aboutsummaryrefslogtreecommitdiffstats
path: root/test/lib
diff options
context:
space:
mode:
authorReid Spencer <rspencer@reidspencer.com>2007-04-23 21:21:53 +0000
committerReid Spencer <rspencer@reidspencer.com>2007-04-23 21:21:53 +0000
commit4f6e9ab3d7e4996d38b3bebbfb153d0bd3ef5311 (patch)
tree6807aed62b2ffbc4bce00194ccac2c26192d45b1 /test/lib
parent703f5291c4f7199a95274df5e3381b36f8faf38c (diff)
downloadexternal_llvm-4f6e9ab3d7e4996d38b3bebbfb153d0bd3ef5311.zip
external_llvm-4f6e9ab3d7e4996d38b3bebbfb153d0bd3ef5311.tar.gz
external_llvm-4f6e9ab3d7e4996d38b3bebbfb153d0bd3ef5311.tar.bz2
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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36376 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/lib')
-rw-r--r--test/lib/llvm.exp16
1 files changed, 9 insertions, 7 deletions
diff --git a/test/lib/llvm.exp b/test/lib/llvm.exp
index e724506..4fc9c4a 100644
--- a/test/lib/llvm.exp
+++ b/test/lib/llvm.exp
@@ -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;
}