Pull out this predicate loop into a helper function.
[oota-llvm.git] / test / LLVMC / llvmc.exp
1 load_lib llvm.exp
2
3 # 'false.c' is really C++, so it must be treated differently.
4 set special_file "$srcdir/$subdir/false.c"
5
6 if [ llvm_gcc_supports c ] then {
7     # tcl seems to lack 'filter' which would've made this easier...
8     set temp [glob -nocomplain $srcdir/$subdir/*.{c}]
9     set c_files [list]
10     foreach f $temp { if {$f != $special_file} {lappend c_files $f}}
11
12     RunLLVMTests [lsort $c_files]
13 }
14
15 if [ llvm_gcc_supports c++ ] then {
16     RunLLVMTests [lsort [concat [glob -nocomplain $srcdir/$subdir/*.{cpp}] $special_file]]
17 }
18
19 if [ llvm_gcc_supports objc ] then {
20     RunLLVMTests [lsort [glob -nocomplain $srcdir/$subdir/*.{m}]]
21 }
22
23 if [ llvm_gcc_supports obj-c++ ] then {
24     RunLLVMTests [lsort [glob -nocomplain $srcdir/$subdir/*.{mm}]]
25 }
26
27 RunLLVMTests [lsort [glob -nocomplain $srcdir/$subdir/*.{td}]]