summaryrefslogtreecommitdiffstats
path: root/llvm/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
commit98f713141ace83f6d21c4c0860357c4726a69764 (patch)
treec0f9a411f764b5de398bf693ac2685e14bdca078 /llvm/test/lib
parent3e8d122a25e6aa1b4c2fe029c2b20fe7e3b5072a (diff)
downloadbcm5719-llvm-98f713141ace83f6d21c4c0860357c4726a69764.tar.gz
bcm5719-llvm-98f713141ace83f6d21c4c0860357c4726a69764.zip
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. llvm-svn: 36376
Diffstat (limited to 'llvm/test/lib')
-rw-r--r--llvm/test/lib/llvm.exp16
1 files changed, 9 insertions, 7 deletions
diff --git a/llvm/test/lib/llvm.exp b/llvm/test/lib/llvm.exp
index e7245064532..4fc9c4aa5e1 100644
--- a/llvm/test/lib/llvm.exp
+++ b/llvm/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;
}
OpenPOWER on IntegriCloud