llvm.org GIT mirror llvm / 12d81f3
Replace llvm_gcc_supports_ada and llvm_gcc_supports_objc with just a single llvm_gcc_supports function that takes the language as an argument. Base that function on the new LLVMGCC_LANGS configured variable so that we don't have to execute feature checks during the test run. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36322 91177308-0d34-0410-b5e6-96231b3b80d8 Reid Spencer 13 years ago
3 changed file(s) with 35 addition(s) and 32 deletion(s). Raw diff Collapse all Expand all
0 load_lib llvm.exp
11
2 if [ llvm_gcc_supports_ada ] then {
2 if [ llvm_gcc_supports ada ] then {
33 RunLLVMTests [lsort [glob -nocomplain $srcdir/$subdir/*.{adb,ads}]]
44 }
55
0 load_lib llvm.exp
11
2 if [ llvm_gcc_supports_objc ] then {
2 if [ llvm_gcc_supports objc ] then {
33 RunLLVMTests [lsort [glob -nocomplain $srcdir/$subdir/*.{m}]]
44 }
55
0 # This procedure executes one line of a test case's execution script.
1 proc execOneLine { test PRS outcome lineno line } {
12 set status 0
23 set resultmsg ""
3738 return $resultmsg
3839 }
3940
41 # This prcoedure performs variable substitutions on the RUN: lines of a test
42 # cases.
4043 proc substitute { line test tmpFile } {
4144 global srcroot objroot srcdir objdir subdir target_triplet prcontext
4245 global llvmgcc llvmgxx llvmgcc_version llvmgccmajvers
7477 return $new_line
7578 }
7679
80 # This procedure runs the set of tests for the test_source_files array.
7781 proc RunLLVMTests { test_source_files } {
7882 global srcroot objroot srcdir objdir subdir target_triplet llvmgcc_version
7983 set timeout 60
187191 }
188192 }
189193
190 proc llvm_gcc_supports_objc { } {
191 global llvmgcc
192 catch { set file_h [ open "/tmp/llvm_obj_check.m" w] }
193 set R [ catch { exec $llvmgcc -c "/tmp/llvm_obj_check.m" -o /dev/null >& /tmp/llvm_obj_check.out } ]
194 set RESULT [ file size "/tmp/llvm_obj_check.out" ]
195 catch { file delete "/tmp/llvm_obj_check.m" }
196 catch { file delete "/tmp/llvm_obj_check.out" }
197 if { $RESULT == 0 } {
198 return 1
199 } else {
200 return 0
201 }
202 }
203
204 proc llvm_gcc_supports_ada { } {
205 global llvmgcc
206 catch { set file_h [ open "/tmp/llvm_ada_check.adb" w] }
207 catch { puts $file_h "procedure llvm_ada_check is begin null; end;" }
208 catch { close $file_h }
209 set R [ catch { exec $llvmgcc -c -gnats "/tmp/llvm_ada_check.adb" >& /tmp/llvm_ada_check.out } ]
210 set RESULT [ file size "/tmp/llvm_ada_check.out" ]
211 catch { file delete "/tmp/llvm_ada_check.adb" }
212 catch { file delete "/tmp/llvm_ada_check.out" }
213 if { $RESULT == 0 } {
214 return 1
215 } else {
216 return 0
217 }
218 }
219
194 # This procedure provides an interface to check the LLVMGCC_LANGS makefile
195 # variable to see if llvm-gcc supports compilation of a particular language.
196 proc llvm_gcc_supports { lang } {
197 global llvmgcc llvmgcc_langs
198 # validate the language choices and determine the name of the compiler
199 # component responsible for determining if the compiler has been built.
200 switch "$lang" {
201 ada { set file gnat1 }
202 c { set file cc1 }
203 c++ { set file cc1plus }
204 objc { set file cc1 }
205 objc++ { set file cc1 }
206 fortran { set file fcc1 }
207 default { return 0 }
208 }
209 if { [ regexp $lang $llvmgcc_langs match ] } {
210 # FIXME: Knowing it is configured is not enough. We should do two more
211 # checks here. First, we need to run llvm-gcc -print-prog-name=$file to get
212 # the path to the compiler. If we don't get a path, the language isn't
213 # properly configured or built. If we do get a path, we should check to make
214 # sure that it is executable and perhaps even try executing it.
215 return 1;
216 }
217 return 0;
218 }
219
220 # This procedure provides an interface to check the TARGETS_TO_BUILD makefile
221 # variable to see if a particular target has been configured to build. This
222 # helps avoid running tests for targets that aren't available.
220223 proc llvm_supports_target { tgtName } {
221224 global TARGETS_TO_BUILD
222225 foreach target [split $TARGETS_TO_BUILD] {