aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.c-torture/special/special.exp
blob: d37d18c8a1dbcc0d85d94fa1a03e5f9d0f600aa0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
# Copyright (C) 1988, 90-96, 1997 Free Software Foundation, Inc.

# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
# 
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
# 
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  

# Please email any bugs, comments, and/or additions to this file to:
# bug-gcc@prep.ai.mit.edu

# This file was written by Rob Savoye. (rob@cygnus.com)

#
# These tests come from Torbjorn Granlund (tege@cygnus.com)
# C torture test suite.
#

if $tracelevel then {
    strace $tracelevel
}

# load support procs
load_lib c-torture.exp
load_lib gcc-dg.exp

################## ADD NEXT CASE HERE (NOT AT THE END) ##################

# 981006-1
# For MIPS at least, pic is needed to trigger the problem.
dg-init
if { [istarget rs6000-*-aix*]
     || [istarget powerpc*-*-aix*]
     || [istarget arm*-*-*]
} {
    set extra_flags ""
} else {
    set extra_flags "-fpic"
}
dg-runtest $srcdir/$subdir/981006-1.c "-Wuninitialized -O2 $extra_flags" ""
dg-finish

# 921210-1
set lines [gcc_target_compile $srcdir/$subdir/921210-1.c "" preprocess ""]
set lines [prune [split [prune_warnings [prune_gcc_output $lines]] "\n"] ""]
set line [lindex $lines [expr [llength $lines]-1]]
regsub -all " " $line "" clean
if [expr [string compare $clean "(a->f+1)+1"]==0] then {
    pass "921210-1.c"
} else {
    fail "921210-1.c"
}

# 920521-1
c-torture 920521-1.c "-S"

# 920520-1
c-torture 920520-1.c "-S"

# 920717-1
if [isnative] then {
    set lines [gcc_target_compile "$srcdir/$subdir/920717-x.c" "920717-x.o" object {additional_flags="-w"}]
    if ![string match "" $lines] then {
	fail "920717-x.c"
    } else {
	# This is a completely bogus test. Sorry.
	catch exec "rm -f 920717-y.o"
	send_log "cc -c $srcdir/$subdir/920717-y.c 2>/dev/null >/dev/null\n"
	catch exec "cc -c $srcdir/$subdir/920717-y.c 2>/dev/null >/dev/null"
	if ![file exists "920717-y.o"] then {
	    send_log "c89 -c $srcdir/$subdir/920717-y.c 2>/dev/null >/dev/null\n"
	    catch exec "c89 -c $srcdir/$subdir/920717-y.c 2>/dev/null >/dev/null"
	}
	if [file exists "920717-y.o"] then {
	    set lines [gcc_target_compile "920717-y.o x.o" "x" executable ""]
	    if [string match "" $lines] then {
		pass "920717-1.c"
	    } else {
		fail "920717-1.c"
	    }
	}
    }
}

# 920730-1
if [isnative] then {
    c-torture "920730-1.c"
    c-torture "920730-1.c" "-traditional"
}

# 920413-1
c-torture 920413-1.c "-Wtraditional"

# 930510-1
dg-init
dg-runtest $srcdir/$subdir/930510-1.c "" ""
dg-finish

# 951130-1
c-torture 951130-1.c "-Werror"

# 960224-1
c-torture 960224-1.c "-E -ansi -pedantic-errors"

# 960224-2
#c-torture 960224-2.c "-E -ansi -pedantic-errors"

c-torture-execute $srcdir/$subdir/eeprof-1.c "-finstrument-functions"