Initial revision
[official-gcc.git] / gcc / testsuite / gcc.c-torture / special / special.exp
blob9b1142149e62484d5e785b8863372579d8a9ccd8
1 # Copyright (C) 1988, 90-96, 1997 Free Software Foundation, Inc.
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.
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., 675 Mass Ave, Cambridge, MA 02139, USA.
17 # Please email any bugs, comments, and/or additions to this file to:
18 # bug-gcc@prep.ai.mit.edu
20 # This file was written by Rob Savoye. (rob@cygnus.com)
23 # These tests come from Torbjorn Granlund (tege@cygnus.com)
24 # C torture test suite.
27 if $tracelevel then {
28 strace $tracelevel
31 # load support procs
32 load_lib c-torture.exp
33 load_lib gcc-dg.exp
35 ################## ADD NEXT CASE HERE (NOT AT THE END) ##################
37 # 921210-1
38 set lines [gcc_target_compile $srcdir/$subdir/921210-1.c "" preprocess ""]
39 set lines [split [prune_warnings [prune_gcc_output $lines]] "\n"]
40 set line [lindex $lines [expr [llength $lines]-1]]
41 regsub -all " " $line "" clean
42 if [expr [string compare $clean "(a->f+1)+1"]==0] then {
43 pass "921210-1.c"
44 } else {
45 fail "921210-1.c"
48 # 920521-1
49 c-torture 920521-1.c "-S"
51 # 920520-1
52 c-torture 920520-1.c "-S"
54 # 920717-1
55 if [isnative] then {
56 set lines [gcc_target_compile "$srcdir/$subdir/920717-x.c" "920717-x.o" object {additional_flags="-w"}]
57 if ![string match "" $lines] then {
58 fail "920717-x.c"
59 } else {
60 # This is a completely bogus test. Sorry.
61 catch exec "rm -f 920717-y.o"
62 send_log "cc -c $srcdir/$subdir/920717-y.c 2>/dev/null >/dev/null\n"
63 catch exec "cc -c $srcdir/$subdir/920717-y.c 2>/dev/null >/dev/null"
64 if ![file exists "920717-y.o"] then {
65 send_log "c89 -c $srcdir/$subdir/920717-y.c 2>/dev/null >/dev/null\n"
66 catch exec "c89 -c $srcdir/$subdir/920717-y.c 2>/dev/null >/dev/null"
68 if [file exists "920717-y.o"] then {
69 set lines [gcc_target_compile "920717-y.o x.o" "x" executable ""]
70 if [string match "" $lines] then {
71 pass "920717-1.c"
72 } else {
73 fail "920717-1.c"
79 # 920730-1
80 if [isnative] then {
81 c-torture "920730-1.c"
82 c-torture "920730-1.c" "-traditional"
85 # 920413-1
86 c-torture 920413-1.c "-Wtraditional"
88 # 930510-1
89 dg-init
90 dg-runtest $srcdir/$subdir/930510-1.c "" ""
91 dg-finish
93 # 951130-1
94 c-torture 951130-1.c "-Werror"
96 # 960224-1
97 c-torture 960224-1.c "-E -ansi -pedantic-errors"
99 # 960224-2
100 #c-torture 960224-2.c "-E -ansi -pedantic-errors"