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

Subversion Repositories scarts

[/] [scarts/] [trunk/] [toolchain/] [scarts-gcc/] [gcc-4.1.1/] [gcc/] [testsuite/] [gcc.dg/] [compat/] [compat.exp] - Blame information for rev 12

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 12 jlechner
# Copyright (C) 2002, 2003 Free Software Foundation, Inc.
2
 
3
# This program is free software; you can redistribute it and/or modify
4
# it under the terms of the GNU General Public License as published by
5
# the Free Software Foundation; either version 2 of the License, or
6
# (at your option) any later version.
7
#
8
# This program is distributed in the hope that it will be useful,
9
# but WITHOUT ANY WARRANTY; without even the implied warranty of
10
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11
# GNU General Public License for more details.
12
#
13
# You should have received a copy of the GNU General Public License
14
# along with this program; if not, write to the Free Software
15
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
16
#
17
# This file was written by Janis Johnson, 
18
 
19
 
20
# Test interoperability of two compilers that follow the same ABI.
21
#
22
# Break simple tests into two pieces and see that they work when linked
23
# together.  If an alternate compiler is specified then the two main
24
# pieces of each test are compiled with different compilers.  The
25
# alternate compiler must be installed, and is specified by defining
26
# ALT_CC_UNDER_TEST in the environment.
27
 
28
if $tracelevel then {
29
    strace $tracelevel
30
}
31
 
32
global GCC_UNDER_TEST
33
 
34
# Load procedures from common libraries.
35
load_lib standard.exp
36
load_lib gcc.exp
37
 
38
#
39
# compat-use-alt-compiler -- make the alternate compiler the default
40
#
41
proc compat-use-alt-compiler { } {
42
    global GCC_UNDER_TEST ALT_CC_UNDER_TEST
43
    global same_alt
44
 
45
    # We don't need to do this if the alternate compiler is actually
46
    # the same as the compiler under test.
47
    if { $same_alt == 0 } then {
48
        set GCC_UNDER_TEST $ALT_CC_UNDER_TEST
49
    }
50
}
51
 
52
#
53
# compat-use-tst-compiler -- make compiler under test the default
54
#
55
proc compat-use-tst-compiler { } {
56
    global GCC_UNDER_TEST save_gcc_under_test
57
    global same_alt
58
 
59
    # We don't need to do this if the alternate compiler is actually
60
    # the same as the compiler under test.
61
 
62
    if { $same_alt == 0 } then {
63
        set GCC_UNDER_TEST $save_gcc_under_test
64
    }
65
}
66
 
67
# Load the language-independent compabibility support procedures.
68
# This must be done after the compat-use-*-compiler definitions.
69
load_lib compat.exp
70
 
71
gcc_init
72
 
73
# Save variables for the C compiler under test, which each test will
74
# change a couple of times.  This must be done after calling gcc-init.
75
set save_gcc_under_test $GCC_UNDER_TEST
76
 
77
# Define an identifier for use with this suite to avoid name conflicts
78
# with other compat tests running at the same time.
79
set sid "c_compat"
80
 
81
# Find out whether there is an alternate compiler to test.  If the
82
# variable is defined but is set to "same", that means we use the same
83
# compiler twice, which is meaningful if the two parts of COMPAT_OPTIONS
84
# are different.
85
set use_alt 0
86
set same_alt 0
87
if [info exists ALT_CC_UNDER_TEST] then {
88
    set use_alt 1
89
    if [string match "same" $ALT_CC_UNDER_TEST] then {
90
        set same_alt 1
91
    }
92
}
93
 
94
# Main loop.
95
foreach src [lsort [find $srcdir/$subdir *_main.c]] {
96
    # If we're only testing specific files and this isn't one of them, skip it.
97
    if ![runtest_file_p $runtests $src] then {
98
        continue
99
    }
100
 
101
    compat-execute $src $sid $use_alt
102
}
103
 
104
# Restore the original compiler under test.
105
compat-use-tst-compiler

powered by: WebSVN 2.1.0

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