llvm.org GIT mirror llvm / f3e2d80
Remove prcontext. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81427 91177308-0d34-0410-b5e6-96231b3b80d8 Daniel Dunbar 10 years ago
5 changed file(s) with 2 addition(s) and 49 deletion(s). Raw diff Collapse all Expand all
649649
The target triplet that corresponds to the current host machine (the one
650650 running the test cases). This should probably be called "host".
651651
652
prcontext (%prcontext)
653
Path to the prcontext tcl script that prints some context around a
654 line that matches a pattern. This isn't strictly necessary as the test suite
655 is run with its PATH altered to include the test/Scripts directory where
656 the prcontext script is located. Note that this script is similar to
657 grep -C but you should use the prcontext script because
658 not all platforms support grep -C.
659
660652
llvmgcc (%llvmgcc)
661653
The full path to the llvm-gcc executable as specified in the
662654 configured LLVM environment
132132 @echo 'set TARGETS_TO_BUILD "$(TARGETS_TO_BUILD)"' >> site.tmp
133133 @echo 'set llvmgcc_langs "$(LLVMGCC_LANGS)"' >> site.tmp
134134 @echo 'set llvmgcc_version "$(LLVMGCC_VERSION)"' >> site.tmp
135 @echo 'set prcontext "$(TCLSH) $(LLVM_SRC_ROOT)/test/Scripts/prcontext.tcl"' >> site.tmp
136135 @echo 'set llvmtoolsdir "$(ToolDir)"' >>site.tmp
137136 @echo 'set llvmlibsdir "$(LibDir)"' >>site.tmp
138137 @echo 'set srcroot "$(LLVM_SRC_ROOT)"' >>site.tmp
+0
-36
test/Scripts/prcontext.tcl less more
None #!/usr/bin/tclsh
1 #
2 # Usage:
3 # prcontext <# lines of context>
4 # (for platforms that don't have grep -C)
5
6
7 #
8 # Get the arguments
9 #
10 set pattern [lindex $argv 0]
11 set num [lindex $argv 1]
12
13
14 #
15 # Get all of the lines in the file.
16 #
17 set lines [split [read stdin] \n]
18
19 set index 0
20 foreach line $lines {
21 if { [regexp $pattern $line match matchline] } {
22 if { [ expr [expr $index - $num] < 0 ] } {
23 set bottom 0
24 } else {
25 set bottom [expr $index - $num]
26 }
27 set endLineNum [ expr [expr $index + $num] + 1]
28 while {$bottom < $endLineNum} {
29 set output [lindex $lines $bottom]
30 puts $output
31 set bottom [expr $bottom + 1]
32 }
33 }
34 set index [expr $index + 1]
35 }
4545 # This procedure performs variable substitutions on the RUN: lines of a test
4646 # cases.
4747 proc substitute { line test tmpFile } {
48 global srcroot objroot srcdir objdir subdir target_triplet prcontext
48 global srcroot objroot srcdir objdir subdir target_triplet
4949 global llvmgcc llvmgxx llvmgcc_version llvmgccmajvers ocamlopt
5050 global gccpath gxxpath compile_c compile_cxx link shlibext llvmlibsdir
5151 global llvmdsymutil valgrind grep gas bugpoint_topts
5656
5757 #replace %% with _#MARKER#_ to make the replacement of %% more predictable
5858 regsub -all {%%} $new_line {_#MARKER#_} new_line
59 #replace %prcontext with prcontext.tcl (Must replace before %p)
60 regsub -all {%prcontext} $new_line $prcontext new_line
6159 #replace %llvmgcc_only with actual path to llvmgcc
6260 regsub -all {%llvmgcc_only} $new_line "$llvmgcc" new_line
6361 #replace %llvmgcc with actual path to llvmgcc
7575 site_exp[m.group(1)] = m.group(2)
7676
7777 # Add substitutions.
78 for sub in ['prcontext', 'llvmgcc', 'llvmgxx', 'compile_cxx', 'compile_c',
78 for sub in ['llvmgcc', 'llvmgxx', 'compile_cxx', 'compile_c',
7979 'link', 'shlibext', 'ocamlopt', 'llvmdsymutil', 'llvmlibsdir',
8080 'bugpoint_topts']:
8181 if sub in ('llvmgcc', 'llvmgxx'):