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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [libgomp/] [testsuite/] [lib/] [libgomp.exp] - Blame information for rev 801

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

Line No. Rev Author Line
1 735 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
 
141
    # We use atomic operations in the testcases to validate results.
142
    if { ([istarget i?86-*-*] || [istarget x86_64-*-*])
143
         && [check_effective_target_ia32] } {
144
        lappend ALWAYS_CFLAGS "additional_flags=-march=i486"
145
    }
146
 
147
    if [istarget *-*-darwin*] {
148
        lappend ALWAYS_CFLAGS "additional_flags=-shared-libgcc"
149
    }
150
 
151
    if [istarget sparc*-*-*] {
152
        lappend ALWAYS_CFLAGS "additional_flags=-mcpu=v9"
153
    }
154
 
155
    if [info exists TOOL_OPTIONS] {
156
        lappend ALWAYS_CFLAGS "additional_flags=$TOOL_OPTIONS"
157
    }
158
 
159
    # Make sure that lines are not wrapped.  That can confuse the
160
    # error-message parsing machinery.
161
    lappend ALWAYS_CFLAGS "additional_flags=-fmessage-length=0"
162
 
163
    # And, gee, turn on OpenMP.
164
    lappend ALWAYS_CFLAGS "additional_flags=-fopenmp"
165
}
166
 
167
#
168
# libgomp_target_compile -- compile a source file
169
#
170
 
171
proc libgomp_target_compile { source dest type options } {
172
    global blddir
173
    global libgomp_compile_options
174
    global gluefile wrap_flags
175
    global ALWAYS_CFLAGS
176
    global GCC_UNDER_TEST
177
    global lang_test_file
178
    global lang_library_path
179
    global lang_link_flags
180
 
181
    if { [info exists lang_test_file] } {
182
        if { $blddir != "" } {
183
            # Some targets use libgfortran.a%s in their specs, so they need
184
            # a -B option for uninstalled testing.
185
            lappend options "additional_flags=-B${blddir}/${lang_library_path}"
186
            lappend options "ldflags=-L${blddir}/${lang_library_path}"
187
        }
188
        lappend options "ldflags=${lang_link_flags}"
189
    }
190
 
191
    if { [target_info needs_status_wrapper] != "" && [info exists gluefile] } {
192
        lappend options "libs=${gluefile}"
193
        lappend options "ldflags=${wrap_flags}"
194
    }
195
 
196
    lappend options "additional_flags=[libio_include_flags]"
197
    lappend options "timeout=[timeout_value]"
198
    lappend options "compiler=$GCC_UNDER_TEST"
199
 
200
    set options [concat $libgomp_compile_options $options]
201
 
202
    if [info exists ALWAYS_CFLAGS] {
203
        set options [concat "$ALWAYS_CFLAGS" $options]
204
    }
205
 
206
    set options [dg-additional-files-options $options $source]
207
 
208
    set result [target_compile $source $dest $type $options]
209
 
210
    return $result
211
}
212
 
213
proc libgomp_option_help { } {
214
    send_user " --additional_options,OPTIONS\t\tUse OPTIONS to compile the testcase files. OPTIONS should be comma-separated.\n"
215
}
216
 
217
proc libgomp_option_proc { option } {
218
    if [regexp "^--additional_options," $option] {
219
        global libgomp_compile_options
220
        regsub "--additional_options," $option "" option
221
        foreach x [split $option ","] {
222
            lappend libgomp_compile_options "additional_flags=$x"
223
        }
224
        return 1
225
    } else {
226
        return 0
227
    }
228
}

powered by: WebSVN 2.1.0

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