OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-stable/] [gcc-4.5.1/] [libgomp/] [testsuite/] [lib/] [libgomp.exp] - Blame information for rev 859

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 273 jeremybenn
# Damn dejagnu for not having proper library search paths for load_lib.
2
# We have to explicitly load everything that gcc-dg.exp wants to load.
3
 
4
proc load_gcc_lib { filename } {
5
    global srcdir loaded_libs
6
 
7
    load_file $srcdir/../../gcc/testsuite/lib/$filename
8
    set loaded_libs($filename) ""
9
}
10
 
11
load_lib dg.exp
12
load_gcc_lib file-format.exp
13
load_gcc_lib target-supports.exp
14
load_gcc_lib target-supports-dg.exp
15
load_gcc_lib scanasm.exp
16
load_gcc_lib scandump.exp
17
load_gcc_lib scanrtl.exp
18
load_gcc_lib scantree.exp
19
load_gcc_lib scanipa.exp
20
load_gcc_lib prune.exp
21
load_gcc_lib target-libpath.exp
22
load_gcc_lib wrapper.exp
23
load_gcc_lib gcc-defs.exp
24
load_gcc_lib torture-options.exp
25
load_gcc_lib timeout.exp
26
load_gcc_lib timeout-dg.exp
27
load_gcc_lib gcc-dg.exp
28
load_gcc_lib gfortran-dg.exp
29
 
30
set dg-do-what-default run
31
 
32
#
33
# GCC_UNDER_TEST is the compiler under test.
34
#
35
 
36
set libgomp_compile_options ""
37
 
38
#
39
# libgomp_init
40
#
41
 
42
if [info exists TOOL_OPTIONS] {
43
    set multilibs [get_multilibs $TOOL_OPTIONS]
44
} else {
45
    set multilibs [get_multilibs]
46
}
47
 
48
proc libgomp_init { args } {
49
    global srcdir blddir objdir tool_root_dir
50
    global libgomp_initialized
51
    global tmpdir
52
    global blddir
53
    global gluefile wrap_flags
54
    global ALWAYS_CFLAGS
55
    global CFLAGS
56
    global TOOL_EXECUTABLE TOOL_OPTIONS
57
    global GCC_UNDER_TEST
58
    global TESTING_IN_BUILD_TREE
59
    global target_triplet
60
    global always_ld_library_path
61
 
62
    set blddir [lookfor_file [get_multilibs] libgomp]
63
 
64
    # We set LC_ALL and LANG to C so that we get the same error
65
    # messages as expected.
66
    setenv LC_ALL C
67
    setenv LANG C
68
 
69
    # Many hosts now default to a non-ASCII C locale, however, so
70
    # they can set a charset encoding here if they need.
71
    if { [ishost "*-*-cygwin*"] } {
72
      setenv LC_ALL C.ASCII
73
      setenv LANG C.ASCII
74
    }
75
 
76
    if ![info exists GCC_UNDER_TEST] then {
77
        if [info exists TOOL_EXECUTABLE] {
78
            set GCC_UNDER_TEST $TOOL_EXECUTABLE
79
        } else {
80
            set GCC_UNDER_TEST "[find_gcc]"
81
        }
82
    }
83
 
84
    if ![info exists tmpdir] {
85
        set tmpdir "/tmp"
86
    }
87
 
88
    if [info exists gluefile] {
89
        unset gluefile
90
    }
91
 
92
    if {![info exists CFLAGS]} {
93
        set CFLAGS ""
94
    }
95
 
96
    # Locate libgcc.a so we don't need to account for different values of
97
    # SHLIB_EXT on different platforms
98
    set gccdir [lookfor_file $tool_root_dir gcc/libgcc.a]
99
    if {$gccdir != ""} {
100
        set gccdir [file dirname $gccdir]
101
    }
102
 
103
    # Compute what needs to be put into LD_LIBRARY_PATH
104
    set always_ld_library_path ".:${blddir}/.libs"
105
 
106
    # Compute what needs to be added to the existing LD_LIBRARY_PATH.
107
    if {$gccdir != ""} {
108
        # Add AIX pthread directory first.
109
        if { [llength [glob -nocomplain ${gccdir}/pthread/libgcc_s*.a]] >= 1 } {
110
            append always_ld_library_path ":${gccdir}/pthread"
111
        }
112
        append always_ld_library_path ":${gccdir}"
113
        set compiler [lindex $GCC_UNDER_TEST 0]
114
 
115
        if { [is_remote host] == 0 && [which $compiler] != 0 } {
116
          foreach i "[exec $compiler --print-multi-lib]" {
117
            set mldir ""
118
            regexp -- "\[a-z0-9=_/\.-\]*;" $i mldir
119
            set mldir [string trimright $mldir "\;@"]
120
            if { "$mldir" == "." } {
121
              continue
122
            }
123
            if { [llength [glob -nocomplain ${gccdir}/${mldir}/libgcc_s*.so.*]] >= 1 } {
124
              append always_ld_library_path ":${gccdir}/${mldir}"
125
            }
126
          }
127
        }
128
    }
129
 
130
    set ALWAYS_CFLAGS ""
131
    if { $blddir != "" } {
132
        lappend ALWAYS_CFLAGS "additional_flags=-B${blddir}/"
133
        # targets that use libgomp.a%s in their specs need a -B option
134
        # for uninstalled testing.
135
        lappend ALWAYS_CFLAGS "additional_flags=-B${blddir}/.libs"
136
        lappend ALWAYS_CFLAGS "additional_flags=-I${blddir}"
137
        lappend ALWAYS_CFLAGS "ldflags=-L${blddir}/.libs"
138
    }
139
    lappend ALWAYS_CFLAGS "additional_flags=-I${srcdir}/.."
140
    lappend ALWAYS_CFLAGS "ldflags=-lgomp"
141
 
142
    # We use atomic operations in the testcases to validate results.
143
    if { ([istarget i?86-*-*] || [istarget x86_64-*-*])
144
         && [check_effective_target_ilp32] } {
145
        lappend ALWAYS_CFLAGS "additional_flags=-march=i486"
146
    }
147
 
148
    if [istarget *-*-darwin*] {
149
        lappend ALWAYS_CFLAGS "additional_flags=-shared-libgcc"
150
    }
151
 
152
    if [istarget sparc*-*-*] {
153
        lappend ALWAYS_CFLAGS "additional_flags=-mcpu=v9"
154
    }
155
 
156
    if [info exists TOOL_OPTIONS] {
157
        lappend ALWAYS_CFLAGS "additional_flags=$TOOL_OPTIONS"
158
    }
159
 
160
    # Make sure that lines are not wrapped.  That can confuse the
161
    # error-message parsing machinery.
162
    lappend ALWAYS_CFLAGS "additional_flags=-fmessage-length=0"
163
 
164
    # And, gee, turn on OpenMP.
165
    lappend ALWAYS_CFLAGS "additional_flags=-fopenmp"
166
}
167
 
168
#
169
# libgomp_target_compile -- compile a source file
170
#
171
 
172
proc libgomp_target_compile { source dest type options } {
173
    global blddir
174
    global libgomp_compile_options
175
    global gluefile wrap_flags
176
    global ALWAYS_CFLAGS
177
    global GCC_UNDER_TEST
178
    global lang_test_file
179
    global lang_library_path
180
    global lang_link_flags
181
 
182
    if { [info exists lang_test_file] } {
183
        if { $blddir != "" } {
184
            # Some targets use libgfortran.a%s in their specs, so they need
185
            # a -B option for uninstalled testing.
186
            lappend options "additional_flags=-B${blddir}/${lang_library_path}"
187
            lappend options "ldflags=-L${blddir}/${lang_library_path}"
188
        }
189
        lappend options "ldflags=${lang_link_flags}"
190
    }
191
 
192
    if { [target_info needs_status_wrapper] != "" && [info exists gluefile] } {
193
        lappend options "libs=${gluefile}"
194
        lappend options "ldflags=${wrap_flags}"
195
    }
196
 
197
    lappend options "additional_flags=[libio_include_flags]"
198
    lappend options "timeout=[timeout_value]"
199
    lappend options "compiler=$GCC_UNDER_TEST"
200
 
201
    set options [concat $libgomp_compile_options $options]
202
 
203
    if [info exists ALWAYS_CFLAGS] {
204
        set options [concat "$ALWAYS_CFLAGS" $options]
205
    }
206
 
207
    set options [dg-additional-files-options $options $source]
208
 
209
    set result [target_compile $source $dest $type $options]
210
 
211
    return $result
212
}
213
 
214
proc libgomp_option_help { } {
215
    send_user " --additional_options,OPTIONS\t\tUse OPTIONS to compile the testcase files. OPTIONS should be comma-separated.\n"
216
}
217
 
218
proc libgomp_option_proc { option } {
219
    if [regexp "^--additional_options," $option] {
220
        global libgomp_compile_options
221
        regsub "--additional_options," $option "" option
222
        foreach x [split $option ","] {
223
            lappend libgomp_compile_options "additional_flags=$x"
224
        }
225
        return 1
226
    } else {
227
        return 0
228
    }
229
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.