------- Additional Comments From janis187 at us dot ibm dot com  2005-01-11 
21:45 -------
Here's how two tests mentioned here can use dg-additional-sources.  I ran
these in gcc.dg.special, which only treats files matching *[0-9].c as tests.
I don't yet know why, but 'dg-do compile' turns into 'dg-do assemble' and
vice versa when dg-additional-sources is used.
                                                                               
                                        
% cat combine-1a.c
extern int printf (const char *, ...);
                                                                               
                                        
struct x { int a; int b; };
                                                                               
                                        
bar (struct x* p)
{
    printf ("%d\n", p->a);
}
% cat combine-1.c
/* { dg-do compile } */
/* { dg-options "-combine -O3" } */
/* { dg-additional-sources combine-1a.c } */
                                                                               
                                        
struct x;
foo (struct x* q)
{
    bar (q);
}
% cat combine-2a.c
#include "combine-2.h"
                                                                               
                                        
int sentence[MAX_WORD];
% cat combine-2b.c
#include "combine-2.h"
% cat combine-2.c
/* { dg-do compile } */
/* { dg-options "-combine" } */
/* { dg-additional-sources "combine-2a.c combine-2b.c" } */
/* { dg-additional-files combine-2.h } */
                                                                               
                                        
#include "combine-2.h"
% cat combine-2.h
#define MAX_WORD 60
                                                                               
                                        
extern int sentence[];

-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17662

Reply via email to