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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-stable/] [gcc-4.5.1/] [gcc/] [testsuite/] [gcc.misc-tests/] [linkage.exp] - Blame information for rev 816

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

Line No. Rev Author Line
1 299 jeremybenn
# Copyright (C) 1988, 90-96, 1997, 2000, 2001, 2002, 2007, 2008, 2010
2
# Free Software Foundation, Inc.
3
 
4
# This program is free software; you can redistribute it and/or modify
5
# it under the terms of the GNU General Public License as published by
6
# the Free Software Foundation; either version 3 of the License, or
7
# (at your option) any later version.
8
#
9
# This program is distributed in the hope that it will be useful,
10
# but WITHOUT ANY WARRANTY; without even the implied warranty of
11
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12
# GNU General Public License for more details.
13
#
14
# You should have received a copy of the GNU General Public License
15
# along with GCC; see the file COPYING3.  If not see
16
# .
17
 
18
# This file used to be gcc.c-torture/special/special.exp, which
19
# was written by Rob Savoye. (rob@cygnus.com)
20
# All the other tests driven by that file have since been moved elsewhere.
21
 
22
if { [isnative] && ![is_remote host] } then {
23
    set lines [gcc_target_compile "$srcdir/$subdir/linkage-x.c" "linkage-x.o" object {additional_flags="-w"}]
24
    if ![string match "" $lines] then {
25
        fail "$subdir/linkage.c compile"
26
    } else {
27
        # This is a completely bogus test. Sorry.
28
 
29
        # Need to ensure ABI for native compiler matches gcc
30
        set native_cflags ""
31
        if  [istarget "mips-sgi-irix6*"] {
32
            set file_string [exec file "linkage-x.o"]
33
            if [ string match "*64*" $file_string ] {
34
                set native_cflags "-64"
35
            }
36
            if [ string match "*ELF 32*" $file_string ] {
37
                set native_cflags "-32"
38
            }
39
            if [ string match "*N32*" $file_string ] {
40
                set native_cflags "-n32"
41
            }
42
        }
43
        if  [istarget "sparc*-sun-solaris2*"] {
44
            set file_string [exec file "linkage-x.o"]
45
            if [ string match "*64*" $file_string ] {
46
                set native_cflags "-xarch=v9"
47
            }
48
        }
49
        if  [istarget "i?86*-*-solaris2*"] {
50
            set file_string [exec file "linkage-x.o"]
51
            if [ string match "*64*" $file_string ] {
52
                set native_cflags "-xarch=amd64"
53
            }
54
        }
55
        if [istarget "s390*-*-linux*"] {
56
            set file_string [exec file "linkage-x.o"]
57
            if [ string match "*32-bit*" $file_string ] {
58
                set native_cflags "-m31"
59
            }
60
            if [ string match "*64-bit*" $file_string ] {
61
                set native_cflags "-m64"
62
            }
63
        } elseif {[istarget "i*86-*-linux*"] || [istarget "x86_64-*-linux*"]} {
64
            set file_string [exec file "linkage-x.o"]
65
            if [ string match "*32-bit*" $file_string ] {
66
                set native_cflags "-m32"
67
            }
68
            if [ string match "*64-bit*" $file_string ] {
69
                set native_cflags "-m64"
70
            }
71
        } elseif [istarget "*-hp-hpux*"] {
72
            set file_string [exec file "linkage-x.o"]
73
            if [ string match "*ELF-64*" $file_string ] {
74
                set native_cflags "+DD64"
75
            }
76
        } elseif [istarget "powerpc*-*-linux*"] {
77
            set file_string [exec file "linkage-x.o"]
78
            if [ string match "*64-bit*" $file_string ] {
79
                set native_cflags "-m64"
80
            } elseif [ string match "*32-bit*" $file_string ] {
81
                set native_cflags "-m32"
82
            }
83
        } elseif [istarget "powerpc*-*-darwin*"] {
84
            set file_string [exec file "linkage-x.o"]
85
            if [ string match "*ppc64" $file_string ] {
86
                set native_cflags "-m64"
87
            } elseif [ string match "*ppc" $file_string ] {
88
                set native_cflags "-m32"
89
            }
90
        } elseif [istarget "*86*-*-darwin*"] {
91
           set file_string [exec file "linkage-x.o"]
92
           if [ string match "*64*" $file_string ] {
93
                set native_cflags "-m64"
94
           } elseif [ string match "*i386" $file_string ] {
95
                set native_cflags "-m32"
96
           }
97
        }
98
 
99
        if [file exists "linkage-y.o"] then {
100
            file delete "linkage-y.o"
101
        }
102
        send_log "cc -c $native_cflags $srcdir/$subdir/linkage-y.c >&/dev/null\n"
103
        catch { exec cc -c $native_cflags "$srcdir/$subdir/linkage-y.c" >&/dev/null }
104
        if ![file exists "linkage-y.o"] then {
105
            send_log "c89 -c $native_cflags $srcdir/$subdir/linkage-y.c >&/dev/null\n"
106
            catch { exec c89 -c $native_cflags "$srcdir/$subdir/linkage-y.c" >&/dev/null }
107
        }
108
        if [file exists "linkage-y.o"] then {
109
            set lines [gcc_target_compile "linkage-y.o linkage-x.o" "linkage.exe" executable ""]
110
            if [string match "" $lines] then {
111
                pass "$subdir/linkage.c link"
112
                file delete "linkage.exe"
113
            } else {
114
                fail "$subdir/linkage.c link"
115
            }
116
            file delete "linkage-y.o"
117
        } else {
118
            unsupported "$subdir/linkage.c native compile failed"
119
        }
120
        file delete "linkage-x.o"
121
    }
122
}

powered by: WebSVN 2.1.0

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