diff options
author | Zack Weinberg <zack@wolery.cumb.org> | 2000-06-29 19:55:26 +0000 |
---|---|---|
committer | Zack Weinberg <zack@gcc.gnu.org> | 2000-06-29 19:55:26 +0000 |
commit | d1e43c8bf095960b34fc36a18150b81c300f05ce (patch) | |
tree | 0f585c9ef681e4c8258523a00fd2668646f3a4e8 | |
parent | 122168d7b2905b6a7f57f43b3ca54bbc8ece5dce (diff) | |
download | gcc-d1e43c8bf095960b34fc36a18150b81c300f05ce.zip gcc-d1e43c8bf095960b34fc36a18150b81c300f05ce.tar.gz gcc-d1e43c8bf095960b34fc36a18150b81c300f05ce.tar.bz2 |
Move the c-torture/noncompile tests to either gcc.dg/cpp or a new gcc.dg/noncompile directory...
Move the c-torture/noncompile tests to either gcc.dg/cpp or a new
gcc.dg/noncompile directory, depending on whether they're
preprocessor tests or not. Annotate all the tests for the dg
framework.
* gcc.c-torture/noncompile/noncompile.exp: Delete.
* gcc.dg/noncompile/noncompile.exp: New.
* Moved files:
Old name New name
gcc.c-torture/noncompile/920507-1.c gcc.dg/noncompile/920507-1.c
gcc.c-torture/noncompile/920616-2.c gcc.dg/noncompile/920616-2.c
gcc.c-torture/noncompile/920721-2.c gcc.dg/noncompile/920721-2.c
gcc.c-torture/noncompile/920824-1.c gcc.dg/noncompile/920824-1.c
gcc.c-torture/noncompile/920923-1.c gcc.dg/noncompile/920923-1.c
gcc.c-torture/noncompile/921102-1.c gcc.dg/noncompile/921102-1.c
gcc.c-torture/noncompile/921116-1.c gcc.dg/noncompile/921116-1.c
gcc.c-torture/noncompile/930301-1.c gcc.dg/noncompile/930301-1.c
gcc.c-torture/noncompile/930622-1.c gcc.dg/noncompile/930622-1.c
gcc.c-torture/noncompile/930622-2.c gcc.dg/noncompile/930622-2.c
gcc.c-torture/noncompile/930714-1.c gcc.dg/noncompile/930714-1.c
gcc.c-torture/noncompile/931203-1.c gcc.dg/noncompile/931203-1.c
gcc.c-torture/noncompile/940112-1.c gcc.dg/noncompile/940112-1.c
gcc.c-torture/noncompile/940227-1.c gcc.dg/noncompile/940227-1.c
gcc.c-torture/noncompile/940510-1.c gcc.dg/noncompile/940510-1.c
gcc.c-torture/noncompile/950825-1.c gcc.dg/noncompile/950825-1.c
gcc.c-torture/noncompile/950921-1.c gcc.dg/noncompile/950921-1.c
gcc.c-torture/noncompile/951123-1.c gcc.dg/noncompile/951123-1.c
gcc.c-torture/noncompile/971104-1.c gcc.dg/noncompile/971104-1.c
gcc.c-torture/noncompile/990416-1.c gcc.dg/noncompile/990416-1.c
gcc.c-torture/noncompile/init-1.c gcc.dg/noncompile/init-1.c
gcc.c-torture/noncompile/init-2.c gcc.dg/noncompile/init-2.c
gcc.c-torture/noncompile/invalid_asm.c gcc.dg/noncompile/invalid_asm.c
gcc.c-torture/noncompile/va-arg-1.c gcc.dg/noncompile/va-arg-1.c
gcc.c-torture/noncompile/940712-1.c gcc.dg/cpp/19940712-1.c
gcc.c-torture/noncompile/940712-1.h gcc.dg/cpp/19940712-1.h
gcc.c-torture/noncompile/940712-1a.h gcc.dg/cpp/19940712-1a.h
gcc.c-torture/noncompile/940712-1b.h gcc.dg/cpp/19940712-1b.h
gcc.c-torture/noncompile/951025-1.c gcc.dg/cpp/19951025-1.c
gcc.c-torture/noncompile/951227-1.c gcc.dg/cpp/19951227-1.c
From-SVN: r34791
56 files changed, 363 insertions, 463 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index c36b207..f7201e8 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,5 +1,50 @@ 2000-06-29 Zack Weinberg <zack@wolery.cumb.org> + + Move the c-torture/noncompile tests to either gcc.dg/cpp or a new + gcc.dg/noncompile directory, depending on whether they're + preprocessor tests or not. Annotate all the tests for the dg + framework. + + * gcc.c-torture/noncompile/noncompile.exp: Delete. + * gcc.dg/noncompile/noncompile.exp: New. + + * Moved files: + Old name New name + gcc.c-torture/noncompile/920507-1.c gcc.dg/noncompile/920507-1.c + gcc.c-torture/noncompile/920616-2.c gcc.dg/noncompile/920616-2.c + gcc.c-torture/noncompile/920721-2.c gcc.dg/noncompile/920721-2.c + gcc.c-torture/noncompile/920824-1.c gcc.dg/noncompile/920824-1.c + gcc.c-torture/noncompile/920923-1.c gcc.dg/noncompile/920923-1.c + gcc.c-torture/noncompile/921102-1.c gcc.dg/noncompile/921102-1.c + gcc.c-torture/noncompile/921116-1.c gcc.dg/noncompile/921116-1.c + gcc.c-torture/noncompile/930301-1.c gcc.dg/noncompile/930301-1.c + gcc.c-torture/noncompile/930622-1.c gcc.dg/noncompile/930622-1.c + gcc.c-torture/noncompile/930622-2.c gcc.dg/noncompile/930622-2.c + gcc.c-torture/noncompile/930714-1.c gcc.dg/noncompile/930714-1.c + gcc.c-torture/noncompile/931203-1.c gcc.dg/noncompile/931203-1.c + gcc.c-torture/noncompile/940112-1.c gcc.dg/noncompile/940112-1.c + gcc.c-torture/noncompile/940227-1.c gcc.dg/noncompile/940227-1.c + gcc.c-torture/noncompile/940510-1.c gcc.dg/noncompile/940510-1.c + gcc.c-torture/noncompile/950825-1.c gcc.dg/noncompile/950825-1.c + gcc.c-torture/noncompile/950921-1.c gcc.dg/noncompile/950921-1.c + gcc.c-torture/noncompile/951123-1.c gcc.dg/noncompile/951123-1.c + gcc.c-torture/noncompile/971104-1.c gcc.dg/noncompile/971104-1.c + gcc.c-torture/noncompile/990416-1.c gcc.dg/noncompile/990416-1.c + gcc.c-torture/noncompile/init-1.c gcc.dg/noncompile/init-1.c + gcc.c-torture/noncompile/init-2.c gcc.dg/noncompile/init-2.c + gcc.c-torture/noncompile/invalid_asm.c gcc.dg/noncompile/invalid_asm.c + gcc.c-torture/noncompile/va-arg-1.c gcc.dg/noncompile/va-arg-1.c + + gcc.c-torture/noncompile/940712-1.c gcc.dg/cpp/19940712-1.c + gcc.c-torture/noncompile/940712-1.h gcc.dg/cpp/19940712-1.h + gcc.c-torture/noncompile/940712-1a.h gcc.dg/cpp/19940712-1a.h + gcc.c-torture/noncompile/940712-1b.h gcc.dg/cpp/19940712-1b.h + gcc.c-torture/noncompile/951025-1.c gcc.dg/cpp/19951025-1.c + gcc.c-torture/noncompile/951227-1.c gcc.dg/cpp/19951227-1.c + +2000-06-29 Zack Weinberg <zack@wolery.cumb.org> + * gcc.dg/cpp/20000628-1a.h: On each of the first three inclusions, declare one variable. On the fourth, error. * gcc.dg/cpp/20000628-1.c (main): Reference the three variables diff --git a/gcc/testsuite/gcc.c-torture/noncompile/920507-1.c b/gcc/testsuite/gcc.c-torture/noncompile/920507-1.c deleted file mode 100644 index 07f2fd0..0000000 --- a/gcc/testsuite/gcc.c-torture/noncompile/920507-1.c +++ /dev/null @@ -1 +0,0 @@ -x(){register*a asm("unknown_register");int*v[1]={a};} diff --git a/gcc/testsuite/gcc.c-torture/noncompile/920616-2.c b/gcc/testsuite/gcc.c-torture/noncompile/920616-2.c deleted file mode 100644 index ddfa0de..0000000 --- a/gcc/testsuite/gcc.c-torture/noncompile/920616-2.c +++ /dev/null @@ -1 +0,0 @@ -f(void a,...){} diff --git a/gcc/testsuite/gcc.c-torture/noncompile/920721-2.c b/gcc/testsuite/gcc.c-torture/noncompile/920721-2.c deleted file mode 100644 index 4621983..0000000 --- a/gcc/testsuite/gcc.c-torture/noncompile/920721-2.c +++ /dev/null @@ -1 +0,0 @@ -f(int n){int s;for(s=0;s<n;s++)s==5?1 n=1;} diff --git a/gcc/testsuite/gcc.c-torture/noncompile/920824-1.c b/gcc/testsuite/gcc.c-torture/noncompile/920824-1.c deleted file mode 100644 index 36661f6..0000000 --- a/gcc/testsuite/gcc.c-torture/noncompile/920824-1.c +++ /dev/null @@ -1 +0,0 @@ -struct s{struct s{int i;}x;}; diff --git a/gcc/testsuite/gcc.c-torture/noncompile/920923-1.c b/gcc/testsuite/gcc.c-torture/noncompile/920923-1.c deleted file mode 100644 index 52f8338..0000000 --- a/gcc/testsuite/gcc.c-torture/noncompile/920923-1.c +++ /dev/null @@ -1,36 +0,0 @@ -typedef BYTE unsigned char;typedef int item_n;typedef int perm_set;struct -PENT{caddr_t v_addr;};typedef struct PENT prec;typedef struct PENT* -prec_t;prec_t mem_hash;BYTE*mem_base;struct PTE{BYTE*p_page;perm_set -p_perms;};typedef struct PTE pte;struct PTP{union{struct*PTP -p_tablep;struct*PTE p_entry;}u;int valid;};typedef struct PTP -(u.p_tablep);int pfree=0;int pcount=0;void mmu_walk_find(va)caddr_t va;{ -BYTE*page_addr;if(mmu_base[Level1(va)]->valid==0x0){l1_base= -mmu_base[Level1(va)]->(u.p_tablep)=p_alloc();mmu_base[Level1(va)]->valid= -0x3;for(idx=0;idx<LEVEL1_ENTRIES;idx++)l1_base[idx]->valid=0x0;goto -build_level2;}else l1_base=mmu_base[Level1(va)]->(u.p_tablep);if -(l1_base[Level2(va)]->valid==0x0){build_level2:l2_base= -l1_base[Level2(va)]->(u.p_tablep)=p_alloc();l1_base[Level2(va)]->valid= -0x3;for(idx=0;idx<LEVEL2_ENTRIES;idx++)l2_base[idx]->valid=0x0;goto -build_page;}else l2_base=mmu_base[Level2(va)]->(u.p_tablep); -page_addr=l2_base[Level2(va)]->valid;}void*a_translate(va_op,v_addr)int -va_op;caddr_t v_addr;{register prec_t bucket;register caddr_t p_addr; -bucket=mem_hash+((((v_addr)>>ITEMBITS))&hash_mask);do{if -(bucket->v_addr==((v_addr)>>ITEMBITS){if(!(bucket->perm_set&va_op)) -goto prot_fault;return mem_base+v_addr;}}while((bucket++)->v_addr!= -((caddr_t)0));page_miss:p_addr=(--bucket)->p_addr;page_type:switch -(p_addr){case BUCKET_FULL:enlarge_hash_table(mem_hash);case((caddr_t)0): -p_addr=fill_item_entry(va_op,v_addr);goto page_type;case((caddr_t)1): -default:((void)(((0))?0:(__eprintf("Failed assertion`%s'at line%d -of`%s'.\n","FALSE",327,"b.c"),0)));}}void flush_hash(hasht, -hash_size)prec_t hasht;int hash_size;{register prec_t bucket;register int -idx;bucket=hasht;for(idx=(hash_size*3)-1;idx>=0;idx--){ -bucket->v_addr=((caddr_t)0);bucket->p_addr=((caddr_t)0); -bucket->perm_set=VA_EMPTY;}}void init_mem(){mem_base=(BYTE*)calloc(1024 -,(1<<13));((void)((mem_base!=(BYTE*)0)?0:(__eprintf("Failed -assertion`%s'at line%d of`%s'.\n","mem_base!=(BYTE*)0",366,"b.c"), -0)));hash_num=INIT_NUM_ENTRIES*3;mem_hash=(prec_t)calloc(hash_num, -sizeof(prec));((void)((mem_hash!=(prec_t)0)?0:(__eprintf("Failed -assertion`%s'at line%d of`%s'.\n","mem_hash!=(prec_t)0",370,"b.c"), -0)));flush_hash(mem_hash,32);build_ptables(mem_base,1024*(1<<13));} -struct tm{int tm_sec;int tm_min;int tm_hour;int tm_mday;int tm_mon;int -tm_year;int tm_wday;int tm_yday;int tm_isdst;char*tm_zone;long tm_gmtoff;}; diff --git a/gcc/testsuite/gcc.c-torture/noncompile/921102-1.c b/gcc/testsuite/gcc.c-torture/noncompile/921102-1.c deleted file mode 100644 index 3fb42f1..0000000 --- a/gcc/testsuite/gcc.c-torture/noncompile/921102-1.c +++ /dev/null @@ -1 +0,0 @@ -int x[]={[0.3 ... 4.6]9}; diff --git a/gcc/testsuite/gcc.c-torture/noncompile/921116-1.c b/gcc/testsuite/gcc.c-torture/noncompile/921116-1.c deleted file mode 100644 index 78a75ea..0000000 --- a/gcc/testsuite/gcc.c-torture/noncompile/921116-1.c +++ /dev/null @@ -1 +0,0 @@ -void a (void x) {} diff --git a/gcc/testsuite/gcc.c-torture/noncompile/930301-1.c b/gcc/testsuite/gcc.c-torture/noncompile/930301-1.c deleted file mode 100644 index de42714..0000000 --- a/gcc/testsuite/gcc.c-torture/noncompile/930301-1.c +++ /dev/null @@ -1,5 +0,0 @@ -struct a *q; -f() -{ - q++; -} diff --git a/gcc/testsuite/gcc.c-torture/noncompile/930622-1.c b/gcc/testsuite/gcc.c-torture/noncompile/930622-1.c deleted file mode 100644 index 27bb9eb..0000000 --- a/gcc/testsuite/gcc.c-torture/noncompile/930622-1.c +++ /dev/null @@ -1,6 +0,0 @@ -f () -{ - double b; - b = b * 10; - goto c; -} diff --git a/gcc/testsuite/gcc.c-torture/noncompile/930622-2.c b/gcc/testsuite/gcc.c-torture/noncompile/930622-2.c deleted file mode 100644 index a75e0c4..0000000 --- a/gcc/testsuite/gcc.c-torture/noncompile/930622-2.c +++ /dev/null @@ -1,6 +0,0 @@ -f () -{ - int i; - for (i--) - ; -} diff --git a/gcc/testsuite/gcc.c-torture/noncompile/940227-1.c b/gcc/testsuite/gcc.c-torture/noncompile/940227-1.c deleted file mode 100644 index 21bba6c9..0000000 --- a/gcc/testsuite/gcc.c-torture/noncompile/940227-1.c +++ /dev/null @@ -1,5 +0,0 @@ -struct font { - struct { - char *line,*ulmask; - } c[2]; -} character[1] = { { {"", ""}, {"", ""} } }; diff --git a/gcc/testsuite/gcc.c-torture/noncompile/940510-1.c b/gcc/testsuite/gcc.c-torture/noncompile/940510-1.c deleted file mode 100644 index 9882d15..0000000 --- a/gcc/testsuite/gcc.c-torture/noncompile/940510-1.c +++ /dev/null @@ -1 +0,0 @@ -struct { int a[]; } x = { 0 }; diff --git a/gcc/testsuite/gcc.c-torture/noncompile/940712-1.c b/gcc/testsuite/gcc.c-torture/noncompile/940712-1.c deleted file mode 100644 index b1b8234..0000000 --- a/gcc/testsuite/gcc.c-torture/noncompile/940712-1.c +++ /dev/null @@ -1,14 +0,0 @@ -/* PR 4713 */ - -#include "940712-1.h" -#include "940712-1a.h" -#include "940712-1b.h" - -/* comment start in comment error -/* in a .c file */ - -int main () -{ - return 0; -} - diff --git a/gcc/testsuite/gcc.c-torture/noncompile/950825-1.c b/gcc/testsuite/gcc.c-torture/noncompile/950825-1.c deleted file mode 100644 index 6104444..0000000 --- a/gcc/testsuite/gcc.c-torture/noncompile/950825-1.c +++ /dev/null @@ -1 +0,0 @@ -main() { return (struct x) {{y: 0}}; } diff --git a/gcc/testsuite/gcc.c-torture/noncompile/950921-1.c b/gcc/testsuite/gcc.c-torture/noncompile/950921-1.c deleted file mode 100644 index bcf2f05..0000000 --- a/gcc/testsuite/gcc.c-torture/noncompile/950921-1.c +++ /dev/null @@ -1,10 +0,0 @@ -typedef enum -{ - a = (X) 0, - b -} c; - -typedef enum -{ - d = (X) 0 -} e; diff --git a/gcc/testsuite/gcc.c-torture/noncompile/951025-1.c b/gcc/testsuite/gcc.c-torture/noncompile/951025-1.c deleted file mode 100644 index 6948872..0000000 --- a/gcc/testsuite/gcc.c-torture/noncompile/951025-1.c +++ /dev/null @@ -1 +0,0 @@ -#include /\ diff --git a/gcc/testsuite/gcc.c-torture/noncompile/951123-1.c b/gcc/testsuite/gcc.c-torture/noncompile/951123-1.c deleted file mode 100644 index e9ed3dc..0000000 --- a/gcc/testsuite/gcc.c-torture/noncompile/951123-1.c +++ /dev/null @@ -1,2 +0,0 @@ -struct S { int a; int b[2]; }; -struct S x = { 0, [0]; }; diff --git a/gcc/testsuite/gcc.c-torture/noncompile/951227-1.c b/gcc/testsuite/gcc.c-torture/noncompile/951227-1.c deleted file mode 100644 index 7c449c8..0000000 --- a/gcc/testsuite/gcc.c-torture/noncompile/951227-1.c +++ /dev/null @@ -1,2 +0,0 @@ -#if 0xe-1 -#endif diff --git a/gcc/testsuite/gcc.c-torture/noncompile/990416-1.c b/gcc/testsuite/gcc.c-torture/noncompile/990416-1.c deleted file mode 100644 index 9d4323b..0000000 --- a/gcc/testsuite/gcc.c-torture/noncompile/990416-1.c +++ /dev/null @@ -1,10 +0,0 @@ -typedef int word_type; - -static void -copy_reg (unsigned int reg, frame_state *udata, frame_state *target_udata) -{ - word_type *preg = get_reg_addr (reg, udata, 0); - word_type *ptreg = get_reg_addr (reg, target_udata, 0); - - memcpy (ptreg, preg, __builtin_dwarf_reg_size (reg)); -} diff --git a/gcc/testsuite/gcc.c-torture/noncompile/init-1.c b/gcc/testsuite/gcc.c-torture/noncompile/init-1.c deleted file mode 100644 index 52f43e8..0000000 --- a/gcc/testsuite/gcc.c-torture/noncompile/init-1.c +++ /dev/null @@ -1,17 +0,0 @@ -struct a -{ double a, b, c; }; - -struct b -{ - struct a arr[6]; -}; - -static struct b a_b = -{ - {0,0,0}, - {0,0,0}, - {0,0,0}, - {0,0,0}, - {0,0,0}, - {0,0,0}, -}; diff --git a/gcc/testsuite/gcc.c-torture/noncompile/init-2.c b/gcc/testsuite/gcc.c-torture/noncompile/init-2.c deleted file mode 100644 index 52ee17b..0000000 --- a/gcc/testsuite/gcc.c-torture/noncompile/init-2.c +++ /dev/null @@ -1 +0,0 @@ -int d[][] = { {1}, {2}, {3} }; diff --git a/gcc/testsuite/gcc.c-torture/noncompile/invalid_asm.c b/gcc/testsuite/gcc.c-torture/noncompile/invalid_asm.c deleted file mode 100644 index bb017f4..0000000 --- a/gcc/testsuite/gcc.c-torture/noncompile/invalid_asm.c +++ /dev/null @@ -1 +0,0 @@ -asm_invalid_register_name(){asm("":::"this_is_an_invalid_register_name");} diff --git a/gcc/testsuite/gcc.c-torture/noncompile/noncompile.exp b/gcc/testsuite/gcc.c-torture/noncompile/noncompile.exp deleted file mode 100644 index 44dcf2e..0000000 --- a/gcc/testsuite/gcc.c-torture/noncompile/noncompile.exp +++ /dev/null @@ -1,325 +0,0 @@ -# Copyright (C) 1988, 90-92, 1997, 1999 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 Jeff Law. (law@cs.utah.edu) - -# -# These tests come from Torbjorn Granlund (tege@cygnus.com) -# C torture test suite. -# - -load_lib mike-gcc.exp - -# This is done just to set the value of TORTURE_OPTIONS. -load_lib c-torture.exp - -proc postbase_with_opts { src run groups } { - global TORTURE_OPTIONS - # loop through all the options - foreach option $TORTURE_OPTIONS { - postbase $src $run $groups $option - } -} - -# Test 920507-1.c -prebase - -set src_code 920507-1.c -set compiler_output ".*:1:" - -set groups {passed gcc-noncompile} - -postbase_with_opts $src_code $run $groups - - -# Test 920616-2.c -prebase - -set src_code 920616-2.c -set compiler_output ".*:1:" - -set groups {passed gcc-noncompile} - -postbase_with_opts $src_code $run $groups - - -# Test 920721-2.c -prebase - -set src_code 920721-2.c -set compiler_output ".*:1:" - -set groups {passed gcc-noncompile} - -postbase_with_opts $src_code $run $groups - - -# Test 920824-1.c -prebase - -set src_code 920824-1.c -set compiler_output ".*:1:" - -set groups {passed gcc-noncompile} - -postbase_with_opts $src_code $run $groups - - -# Test 920923-1.c -prebase - -set src_code 920923-1.c -set compiler_output ".*:1:" - -set groups {passed gcc-noncompile} - -postbase_with_opts $src_code $run $groups - - -# Test 921102-1.c -prebase - -set src_code 921102-1.c -set compiler_output ".*:1:" - -set groups {passed gcc-noncompile} - -postbase_with_opts $src_code $run $groups - - -# Test 921116-1.c -prebase - -set src_code 921116-1.c -set compiler_output ".*:1:" - -set groups {passed gcc-noncompile} - -postbase_with_opts $src_code $run $groups - - -# Test 930301-1.c -prebase - -set src_code 930301-1.c -set compiler_output ".*:4:" - -set groups {passed gcc-noncompile} - -postbase_with_opts $src_code $run $groups - - -# Test 930622-1.c -prebase - -set src_code 930622-1.c -set compiler_output ".*:5:" - -set groups {passed gcc-noncompile} - -postbase_with_opts $src_code $run $groups - - -# Test 930622-2.c -prebase - -set src_code 930622-2.c -set compiler_output ".*:4:" - -set groups {passed gcc-noncompile} - -postbase_with_opts $src_code $run $groups - - -# Test 930714-1.c -prebase - -set src_code 930714-1.c -# Not really sure what the error should be here... -set compiler_output ".*:18.*:23" - -set groups {passed gcc-noncompile} - -postbase_with_opts $src_code $run $groups - -# Test 931203-1.c -prebase - -set src_code 931203-1.c -set compiler_output ".*:10" - -set groups {passed gcc-noncompile} - -postbase_with_opts $src_code $run $groups - - -# Test 940112-1.c -prebase - -set src_code 940112-1.c -set compiler_output ".*:7" - -set groups {passed gcc-noncompile} - -postbase_with_opts $src_code $run $groups - - -# Test 940227-1.c -prebase - -set src_code 940227-1.c -set compiler_output ".*:5.*:5" - -set groups {passed gcc-noncompile} - -postbase_with_opts $src_code $run $groups - - -# Test 940510-1.c -prebase - -set src_code 940510-1.c -set compiler_output ".*:1" - -set groups {passed gcc-noncompile} - -postbase_with_opts $src_code $run $groups - - -# Test 940712-1.c -prebase - -set src_code 940712-1.c -set compiler_output ".*:8.*:4" - -set groups {passed gcc-noncompile} - -postbase_with_opts $src_code $run $groups - - -# Test 950825-1.c -prebase -set src_code 950825-1.c -set compiler_output ".*:1.*:1.*:1:" - -set groups {passed gcc-noncompile} - -postbase_with_opts $src_code $run $groups - - -# Test 950921-1.c -prebase -set src_code 950921-1.c -set compiler_output ".*:3.*:3.*:9.*:9:" - -set groups {passed gcc-noncompile} - -postbase_with_opts $src_code $run $groups - - -# Test 951025-1.c -prebase -set src_code 951025-1.c -set compiler_output ".*:\[12\]:" - -set groups {passed gcc-noncompile} - -postbase_with_opts $src_code $run $groups - - -# Test 951123-1.c -prebase -set src_code 951123-1.c -set compiler_output ".*:2:" - -set groups {passed gcc-noncompile} - -postbase_with_opts $src_code $run $groups - - -# Test 951227-1.c -prebase -set src_code 951227-1.c -set compiler_output ".*:1:" - -set groups {passed gcc-noncompile} - -postbase_with_opts $src_code $run $groups - - -# Test 971104-1.c -prebase -set src_code 971104-1.c -set compiler_output ".*:25:" - -set groups {passed gcc-noncompile} - -postbase_with_opts $src_code $run $groups - -# Test 990416-1.c -prebase -set src_code 990416-1.c -set compiler_output ".*:4:.*:6:.*:6:.*:6:.*:6:.*:6:.*:7:.*:7:" - -set groups {passed gcc-noncompile} - -postbase_with_opts $src_code $run $groups - -# Test init-1.c -prebase -set src_code init-1.c -set compiler_output ".*:12.*:12.*:13.*:13.*:14.*:14.*:15.*:15.*:16.*:16:" - -set groups {passed gcc-noncompile} - -postbase_with_opts $src_code $run $groups - - -# Test init-2.c -prebase -set src_code init-2.c -set compiler_output ".*:1:" - -set groups {passed gcc-noncompile} - -postbase_with_opts $src_code $run $groups - - -# Test invalid_asm.c -prebase -set src_code invalid_asm.c -set compiler_output ".*:1:" - -set groups {passed gcc-noncompile} - -postbase_with_opts $src_code $run $groups - - -# Test va-arg-1.c -# It is debatable if this test should be included at all. -# varags may be implemented by macros, which may not actually -# reference the bogus argument. -prebase - -set src_code va-arg-1.c -set compiler_output ".*:6:" - -set groups {passed gcc-noncompile} - -postbase_with_opts $src_code $run $groups diff --git a/gcc/testsuite/gcc.c-torture/noncompile/va-arg-1.c b/gcc/testsuite/gcc.c-torture/noncompile/va-arg-1.c deleted file mode 100644 index 0285872..0000000 --- a/gcc/testsuite/gcc.c-torture/noncompile/va-arg-1.c +++ /dev/null @@ -1,8 +0,0 @@ -#include <stdarg.h> - -f (int x, ...) -{ - va_list args; - va_start (args, bogus_variable); - va_end (args); -} diff --git a/gcc/testsuite/gcc.dg/cpp/19940712-1.c b/gcc/testsuite/gcc.dg/cpp/19940712-1.c new file mode 100644 index 0000000..5b4ac8b --- /dev/null +++ b/gcc/testsuite/gcc.dg/cpp/19940712-1.c @@ -0,0 +1,19 @@ +/* { dg-do preprocess } */ +/* PR 4713 */ + +/* dg.exp doesn't read the header files for magic comments. */ +/* { dg-error "unterminated comment" "" { target *-*-* } 4 } */ +/* { dg-error "unterminated comment" "" { target *-*-* } 8 } */ + +#include "19940712-1.h" /* { dg-error "" } // In file included from: */ +#include "19940712-1a.h" /* { dg-error "" } // In file included from: */ +#include "19940712-1b.h" + +/* comment start in comment error +/* in a .c file */ + +int main () +{ + return 0; +} + diff --git a/gcc/testsuite/gcc.c-torture/noncompile/940712-1.h b/gcc/testsuite/gcc.dg/cpp/19940712-1.h index 1838213..1838213 100644 --- a/gcc/testsuite/gcc.c-torture/noncompile/940712-1.h +++ b/gcc/testsuite/gcc.dg/cpp/19940712-1.h diff --git a/gcc/testsuite/gcc.c-torture/noncompile/940712-1a.h b/gcc/testsuite/gcc.dg/cpp/19940712-1a.h index 55ab6b8..55ab6b8 100644 --- a/gcc/testsuite/gcc.c-torture/noncompile/940712-1a.h +++ b/gcc/testsuite/gcc.dg/cpp/19940712-1a.h diff --git a/gcc/testsuite/gcc.c-torture/noncompile/940712-1b.h b/gcc/testsuite/gcc.dg/cpp/19940712-1b.h index d75156c..d75156c 100644 --- a/gcc/testsuite/gcc.c-torture/noncompile/940712-1b.h +++ b/gcc/testsuite/gcc.dg/cpp/19940712-1b.h diff --git a/gcc/testsuite/gcc.dg/cpp/19951025-1.c b/gcc/testsuite/gcc.dg/cpp/19951025-1.c new file mode 100644 index 0000000..c243df0 --- /dev/null +++ b/gcc/testsuite/gcc.dg/cpp/19951025-1.c @@ -0,0 +1,4 @@ +/* { dg-do preprocess } */ +/* { dg-error "include expects" "" { target *-*-* } 4 } */ +/* { dg-warning "no newline" "" { target *-*-* } 5 } */ +#include /\ diff --git a/gcc/testsuite/gcc.dg/cpp/19951227-1.c b/gcc/testsuite/gcc.dg/cpp/19951227-1.c new file mode 100644 index 0000000..0d8fcfd --- /dev/null +++ b/gcc/testsuite/gcc.dg/cpp/19951227-1.c @@ -0,0 +1,3 @@ +/* { dg-do preprocess } */ +#if 0xe-1 /* { dg-error "invalid number" } */ +#endif diff --git a/gcc/testsuite/gcc.dg/noncompile/920507-1.c b/gcc/testsuite/gcc.dg/noncompile/920507-1.c new file mode 100644 index 0000000..5f2ff4e --- /dev/null +++ b/gcc/testsuite/gcc.dg/noncompile/920507-1.c @@ -0,0 +1,6 @@ +int +x(void) +{ + register int *a asm("unknown_register"); /* { dg-error "invalid register" } */ + int *v[1] = {a}; +} diff --git a/gcc/testsuite/gcc.dg/noncompile/920616-2.c b/gcc/testsuite/gcc.dg/noncompile/920616-2.c new file mode 100644 index 0000000..25f5943 --- /dev/null +++ b/gcc/testsuite/gcc.dg/noncompile/920616-2.c @@ -0,0 +1 @@ +f(void a,...){} /* { dg-error "has incomplete type" } */ diff --git a/gcc/testsuite/gcc.dg/noncompile/920721-2.c b/gcc/testsuite/gcc.dg/noncompile/920721-2.c new file mode 100644 index 0000000..2326b7e --- /dev/null +++ b/gcc/testsuite/gcc.dg/noncompile/920721-2.c @@ -0,0 +1,6 @@ +int f(int n) +{ +int s; +for(s=0;s<n;s++) + s==5?1 n=1; /* { dg-error "parse error" } */ +} diff --git a/gcc/testsuite/gcc.dg/noncompile/920824-1.c b/gcc/testsuite/gcc.dg/noncompile/920824-1.c new file mode 100644 index 0000000..bc8b19c --- /dev/null +++ b/gcc/testsuite/gcc.dg/noncompile/920824-1.c @@ -0,0 +1 @@ +struct s{struct s{int i;}x;}; /* { dg-error "nested redefinition" } */ diff --git a/gcc/testsuite/gcc.dg/noncompile/920923-1.c b/gcc/testsuite/gcc.dg/noncompile/920923-1.c new file mode 100644 index 0000000..4f03b9f --- /dev/null +++ b/gcc/testsuite/gcc.dg/noncompile/920923-1.c @@ -0,0 +1,124 @@ +typedef BYTE unsigned char; /* { dg-error "syntax error|empty decl" } */ +typedef int item_n; +typedef int perm_set; +struct PENT { caddr_t v_addr; };/* { dg-error "parse error|no semicolon" } */ +typedef struct PENT prec; +typedef struct PENT *prec_t; +prec_t mem_hash; +BYTE *mem_base; /* { dg-error "parse error|no type" } */ +struct PTE { + BYTE *p_page; /* { dg-error "parse error|no semicolon" } */ + perm_set p_perms; +}; /* { dg-error "parse error" } */ +typedef struct PTE pte; +struct PTP { + union { + struct *PTP p_tablep; /* { dg-error "parse error|no semicolon" } */ + struct *PTE p_entry; + } u; /* { dg-warning "no type or storage class" } */ + int valid; +}; /* { dg-error "parse error" } */ +typedef struct PTP (u.p_tablep);/* { dg-error "parse error" } */ +int pfree=0; +int pcount=0; + +void +mmu_walk_find(va) +caddr_t va; /* { dg-error "parse error|no type" } */ +{ + BYTE *page_addr; + if (mmu_base[Level1(va)]->valid==0x0) { + l1_base = mmu_base[Level1(va)]->(u.p_tablep) = p_alloc(); + mmu_base[Level1(va)]->valid = 0x3; /* { dg-error "parse error" } */ + for (idx=0; idx<LEVEL1_ENTRIES; idx++) + l1_base[idx]->valid = 0x0; + goto build_level2; + } else + l1_base = mmu_base[Level1(va)]->(u.p_tablep); + + if (l1_base[Level2(va)]->valid==0x0) { + build_level2: + l2_base = l1_base[Level2(va)]->(u.p_tablep) = p_alloc(); + l1_base[Level2(va)]->valid = 0x3; /* { dg-error "parse error" } */ + for (idx=0; idx<LEVEL2_ENTRIES; idx++) + l2_base[idx]->valid=0x0; + goto build_page; + } else + l2_base = mmu_base[Level2(va)]->(u.p_tablep); + + page_addr = l2_base[Level2(va)]->valid;/* { dg-error "undeclared|no type" } */ +} /* { dg-error "parse error" } */ + +void * +a_translate(va_op, v_addr) +int va_op; +caddr_t v_addr; /* { dg-error "parse error" } */ +{ + register prec_t bucket; + register caddr_t p_addr; /* { dg-error "syntax error" } */ + bucket = mem_hash+((((v_addr)>>ITEMBITS))&hash_mask); /* { dg-error "undeclared|for each function" } */ + do { + if (bucket->v_addr == ((v_addr)>>ITEMBITS) { /* { dg-error "incomplete type|parse error" } */ + if(!(bucket->perm_set&va_op)) + goto prot_fault; + return mem_base + v_addr; + } + } while((bucket++)->v_addr != ((caddr_t)0)); /* { dg-error "parse error" } */ + + page_miss: + p_addr = (--bucket)->p_addr; /* { dg-error "undeclared|pointer to" } */ + page_type: + switch (p_addr) { + case BUCKET_FULL: /* { dg-error "undeclared" } */ + enlarge_hash_table(mem_hash); + case((caddr_t)0): /* { dg-error "undeclared|parse error" } */ + p_addr = fill_item_entry(va_op, v_addr); + goto page_type; + case((caddr_t)1): /* { dg-error "parse error" } */ + default: /* { dg-error "default label" } */ + ((void)(((0))?0:(__eprintf("Failed assertion`%s'at line%d of`%s'.\n", + "FALSE", 327, "b.c"), 0))); + } +} + +void +flush_hash(hasht, hash_size) +prec_t hasht; +int hash_size; +{ + register prec_t bucket; + register int idx; + bucket = hasht; + for(idx=(hash_size*3)-1; idx>=0; idx--) { + bucket->v_addr = ((caddr_t)0);/* { dg-error "undeclared|pointer to|parse error" } */ + bucket->p_addr = ((caddr_t)0);/* { dg-error "pointer to|parse error" } */ + bucket->perm_set = VA_EMPTY; /* { dg-error "undeclared|pointer to" } */ + } +} + +void +init_mem() +{ + mem_base = (BYTE *) calloc(1024, (1<<13)); /* { dg-error "undeclared|parse error" } */ + ((void)((mem_base != (BYTE *)0) /* { dg-error "parse error" } */ + ? 0 + : (__eprintf("Failed assertion`%s'at line%d of`%s'.\n", + "mem_base != (BYTE *)0", 366, "b.c"), + 0))); + hash_num = INIT_NUM_ENTRIES * 3; /* { dg-error "undeclared" } */ + mem_hash = (prec_t) calloc(hash_num, sizeof(prec)); /* { dg-error "incomplete type" } */ + ((void)((mem_hash != (prec_t)0) + ? 0 + : (__eprintf("Failed assertion`%s'at line%d of`%s'.\n", + "mem_hash != (prec_t)0", 370, "b.c"), + 0))); + flush_hash(mem_hash, 32); + build_ptables(mem_base, 1024*(1<<13)); +} + +struct tm { + int tm_sec; int tm_min; int tm_hour; + int tm_mday;int tm_mon; int tm_year; + int tm_wday;int tm_yday;int tm_isdst; + char*tm_zone; long tm_gmtoff; +}; diff --git a/gcc/testsuite/gcc.dg/noncompile/921102-1.c b/gcc/testsuite/gcc.dg/noncompile/921102-1.c new file mode 100644 index 0000000..8b66f71 --- /dev/null +++ b/gcc/testsuite/gcc.dg/noncompile/921102-1.c @@ -0,0 +1 @@ +int x[]={[0.3 ... 4.6]9}; /* { dg-error "nonconstant array|near init" } */ diff --git a/gcc/testsuite/gcc.dg/noncompile/921116-1.c b/gcc/testsuite/gcc.dg/noncompile/921116-1.c new file mode 100644 index 0000000..890bbb6 --- /dev/null +++ b/gcc/testsuite/gcc.dg/noncompile/921116-1.c @@ -0,0 +1 @@ +void a (void x) {} /* { dg-error "has incomplete type" } */ diff --git a/gcc/testsuite/gcc.dg/noncompile/930301-1.c b/gcc/testsuite/gcc.dg/noncompile/930301-1.c new file mode 100644 index 0000000..afabd15 --- /dev/null +++ b/gcc/testsuite/gcc.dg/noncompile/930301-1.c @@ -0,0 +1,5 @@ +struct a *q; +f() +{ + q++; /* { dg-error "pointer to" } */ +} diff --git a/gcc/testsuite/gcc.dg/noncompile/930622-1.c b/gcc/testsuite/gcc.dg/noncompile/930622-1.c new file mode 100644 index 0000000..835e072 --- /dev/null +++ b/gcc/testsuite/gcc.dg/noncompile/930622-1.c @@ -0,0 +1,6 @@ +f () +{ + double b; + b = b * 10; + goto c; /* { dg-error "used but not defined" } */ +} diff --git a/gcc/testsuite/gcc.dg/noncompile/930622-2.c b/gcc/testsuite/gcc.dg/noncompile/930622-2.c new file mode 100644 index 0000000..b7e1b8e --- /dev/null +++ b/gcc/testsuite/gcc.dg/noncompile/930622-2.c @@ -0,0 +1,6 @@ +f () +{ + int i; + for (i--) /* { dg-error "syntax" } */ + ; +} diff --git a/gcc/testsuite/gcc.c-torture/noncompile/930714-1.c b/gcc/testsuite/gcc.dg/noncompile/930714-1.c index d940c55..bdbc133 100644 --- a/gcc/testsuite/gcc.c-torture/noncompile/930714-1.c +++ b/gcc/testsuite/gcc.dg/noncompile/930714-1.c @@ -15,11 +15,11 @@ void test() int (*iptr)(int); int foo[5]; - a = f1; + a = f1; /* { dg-error "incompatible types" } */ a = (YYSTYPE)f1; a = (YYSTYPE)foo; a = (YYSTYPE)(int *)foo; iptr = f1; - a = iptr; + a = iptr; /* { dg-error "incompatible types" } */ a = (YYSTYPE)iptr; } diff --git a/gcc/testsuite/gcc.c-torture/noncompile/931203-1.c b/gcc/testsuite/gcc.dg/noncompile/931203-1.c index 1f5a8c3..0c6a9f2 100644 --- a/gcc/testsuite/gcc.c-torture/noncompile/931203-1.c +++ b/gcc/testsuite/gcc.dg/noncompile/931203-1.c @@ -7,5 +7,5 @@ typedef struct point_t f () { - return 0; + return 0; /* { dg-error "incompatible types" } */ } diff --git a/gcc/testsuite/gcc.c-torture/noncompile/940112-1.c b/gcc/testsuite/gcc.dg/noncompile/940112-1.c index 17dda8b..24780df 100644 --- a/gcc/testsuite/gcc.c-torture/noncompile/940112-1.c +++ b/gcc/testsuite/gcc.dg/noncompile/940112-1.c @@ -4,4 +4,4 @@ f (int x) double e = 1; e = 1; return (e) -} +} /* { dg-error "parse error" } */ diff --git a/gcc/testsuite/gcc.dg/noncompile/940227-1.c b/gcc/testsuite/gcc.dg/noncompile/940227-1.c new file mode 100644 index 0000000..2e6d913 --- /dev/null +++ b/gcc/testsuite/gcc.dg/noncompile/940227-1.c @@ -0,0 +1,5 @@ +struct font { + struct { + char *line,*ulmask; + } c[2]; +} character[1] = { { {"", ""}, {"", ""} } }; /* { dg-error "extra|near|excess" } */ diff --git a/gcc/testsuite/gcc.dg/noncompile/940510-1.c b/gcc/testsuite/gcc.dg/noncompile/940510-1.c new file mode 100644 index 0000000..485c3d2 --- /dev/null +++ b/gcc/testsuite/gcc.dg/noncompile/940510-1.c @@ -0,0 +1 @@ +struct { int a[]; } x = { 0 }; /* { dg-error "array size missing" } */ diff --git a/gcc/testsuite/gcc.dg/noncompile/950825-1.c b/gcc/testsuite/gcc.dg/noncompile/950825-1.c new file mode 100644 index 0000000..4f4c6fb --- /dev/null +++ b/gcc/testsuite/gcc.dg/noncompile/950825-1.c @@ -0,0 +1,4 @@ +main() +{ +return (struct x) {{y: 0}}; /* { dg-error "extra|near|excess|incompatible" } */ +} diff --git a/gcc/testsuite/gcc.dg/noncompile/950921-1.c b/gcc/testsuite/gcc.dg/noncompile/950921-1.c new file mode 100644 index 0000000..ed44338 --- /dev/null +++ b/gcc/testsuite/gcc.dg/noncompile/950921-1.c @@ -0,0 +1,10 @@ +typedef enum +{ + a = (X) 0, /* { dg-error "undeclared|not integer|parse error" } */ + b +} c; + +typedef enum +{ + d = (X) 0 /* { dg-error "undeclared|not integer|parse error" } */ +} e; diff --git a/gcc/testsuite/gcc.dg/noncompile/951123-1.c b/gcc/testsuite/gcc.dg/noncompile/951123-1.c new file mode 100644 index 0000000..9a5a321 --- /dev/null +++ b/gcc/testsuite/gcc.dg/noncompile/951123-1.c @@ -0,0 +1,2 @@ +struct S { int a; int b[2]; }; +struct S x = { 0, [0]; }; /* { dg-error "array index|near|parse" } */ diff --git a/gcc/testsuite/gcc.c-torture/noncompile/971104-1.c b/gcc/testsuite/gcc.dg/noncompile/971104-1.c index 3f0996d..a20b17a 100644 --- a/gcc/testsuite/gcc.c-torture/noncompile/971104-1.c +++ b/gcc/testsuite/gcc.dg/noncompile/971104-1.c @@ -21,6 +21,8 @@ static void up(int sem){ if(semop(semid, &sb, 1) == -1) error("up failure"); if(semctl(semid, sb.sem_num, 12 , semctl_arg) == 0) printf("%s had processes sleeping on it!\n", - ({ "MUTEX ", "BARB_SEM 1", "BARB_SEM 2", "CUST_SEM 1", "CUST_SEM 2", "WA -IT_SEM 1", "WAIT_SEM 2", "WAIT_SEM 3", "WAIT_SEM 4"} [( sb.sem_num )]) ); + ({ "MUTEX ", "BARB_SEM 1", "BARB_SEM 2", "CUST_SEM 1", + "CUST_SEM 2", "WAIT_SEM 1", "WAIT_SEM 2", "WAIT_SEM 3", + "WAIT_SEM 4"} /* { dg-error "parse error" } */ + [( sb.sem_num )]) ); } diff --git a/gcc/testsuite/gcc.dg/noncompile/990416-1.c b/gcc/testsuite/gcc.dg/noncompile/990416-1.c new file mode 100644 index 0000000..ae433ad --- /dev/null +++ b/gcc/testsuite/gcc.dg/noncompile/990416-1.c @@ -0,0 +1,11 @@ +typedef int word_type; + +static void +copy_reg (unsigned int reg, frame_state *udata, /* { dg-error "parse" } */ + frame_state *target_udata) +{ + word_type *preg = get_reg_addr (reg, udata, 0); /* { dg-error "undeclared|function|without a cast" } */ + word_type *ptreg = get_reg_addr (reg, target_udata, 0); /* { dg-error "undeclared|without a cast" } */ + + memcpy (ptreg, preg, __builtin_dwarf_reg_size (reg)); /* { dg-warning "implicit declaration" } */ +} diff --git a/gcc/testsuite/gcc.dg/noncompile/init-1.c b/gcc/testsuite/gcc.dg/noncompile/init-1.c new file mode 100644 index 0000000..007991b --- /dev/null +++ b/gcc/testsuite/gcc.dg/noncompile/init-1.c @@ -0,0 +1,17 @@ +struct a +{ double a, b, c; }; + +struct b +{ + struct a arr[6]; +}; + +static struct b a_b = +{ + {0,0,0}, + {0,0,0}, /* { dg-error "extra brace|excess elements|near" } */ + {0,0,0}, /* { dg-error "extra brace|excess elements|near" } */ + {0,0,0}, /* { dg-error "extra brace|excess elements|near" } */ + {0,0,0}, /* { dg-error "extra brace|excess elements|near" } */ + {0,0,0}, /* { dg-error "extra brace|excess elements|near" } */ +}; diff --git a/gcc/testsuite/gcc.dg/noncompile/init-2.c b/gcc/testsuite/gcc.dg/noncompile/init-2.c new file mode 100644 index 0000000..462e332 --- /dev/null +++ b/gcc/testsuite/gcc.dg/noncompile/init-2.c @@ -0,0 +1 @@ +int d[][] = { {1}, {2}, {3} }; /* { dg-error "incomplete type" } */ diff --git a/gcc/testsuite/gcc.dg/noncompile/invalid_asm.c b/gcc/testsuite/gcc.dg/noncompile/invalid_asm.c new file mode 100644 index 0000000..0cb1479 --- /dev/null +++ b/gcc/testsuite/gcc.dg/noncompile/invalid_asm.c @@ -0,0 +1,4 @@ +asm_invalid_register_name() +{ + asm("":::"this_is_an_invalid_register_name"); /* { dg-error "unknown register" } */ +} diff --git a/gcc/testsuite/gcc.dg/noncompile/noncompile.exp b/gcc/testsuite/gcc.dg/noncompile/noncompile.exp new file mode 100644 index 0000000..f23dcca --- /dev/null +++ b/gcc/testsuite/gcc.dg/noncompile/noncompile.exp @@ -0,0 +1,64 @@ +# Copyright (C) 1997, 2000 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +# Please email any bugs, comments, and/or additions to this file to: +# bug-gcc@prep.ai.mit.edu + +# GCC testsuite that uses the `dg.exp' driver. + +# Load support procs. +load_lib gcc-dg.exp + +# Utility for scanning compiler result, invoked via dg-final. +# Call pass if pattern is present, otherwise fail. +proc scan-assembler { testcase pattern } { + global subdir + + set fd [open [file rootname $testcase].s r] + set text [read $fd] + close $fd + + if [regexp -- $pattern $text] { + pass "$subdir/$testcase scan-assembler" + } else { + fail "$subdir/$testcase scan-assembler" + } +} + +# Call pass if pattern is not present, otherwise fail. +proc scan-assembler-not { testcase pattern } { + global subdir + + set fd [open [file rootname $testcase].s r] + set text [read $fd] + close $fd + + if ![regexp -- $pattern $text] { + pass "$subdir/$testcase scan-assembler-not" + } else { + fail "$subdir/$testcase scan-assembler-not" + } +} + +# Initialize `dg'. +dg-init + +# Main loop. +# Don't run this directory with any default CFLAGS. +dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.\[cS\]]] "" "" + +# All done. +dg-finish diff --git a/gcc/testsuite/gcc.dg/noncompile/va-arg-1.c b/gcc/testsuite/gcc.dg/noncompile/va-arg-1.c new file mode 100644 index 0000000..b8b7d3c --- /dev/null +++ b/gcc/testsuite/gcc.dg/noncompile/va-arg-1.c @@ -0,0 +1,8 @@ +#include <stdarg.h> + +f (int x, ...) +{ + va_list args; + va_start (args, bogus_variable); /* { dg-error "undeclared|for each function|not last named" } */ + va_end (args); +} |