Commit ab17715d by Neil Booth Committed by Neil Booth

* mi6.c, mi6a.h, mi6b.h, mi6c.h, mi6d.h, mi6e.h: New test.

From-SVN: r45900
parent 8c3b2693
2001-09-30 Neil Booth <neil@daikokuya.demon.co.uk>
* mi6.c, mi6a.h, mi6b.h, mi6c.h, mi6d.h, mi6e.h: New test.
2001-09-30 Neil Booth <neil@daikokuya.demon.co.uk>
* gcc.dg/cpp/redef2.c: Add test.
2001-09-27 Geoffrey Keating <geoffk@redhat.com>
......
/* Another test case for over-eager multiple include optimization,
where the leading "#if !defined" expression is obtained partially,
or wholly, from macros. Neil Booth, 30 Sep 2001. */
/* { dg-do compile } */
/* { dg-options "" } */
/* Each include file should not be subject to MI optimisation, since
macro definitions can change. Each header increments the variable
VAR if it is defined.
The first set of inclusions gets the headers into CPP's cache, but
does nothing since VAR is not defined. The second set should each
increment VAR, since none of the initial set should have been
flagged as optimizable. */
#define EMPTY
#define NOT !
#define DEFINED defined (macro)
#define IND ! defined (macro)
#include "mi6a.h"
#include "mi6b.h"
#include "mi6c.h"
#include "mi6d.h"
#include "mi6e.h"
#define VAR five
int
main(void)
{
unsigned int five = 0;
#include "mi6a.h"
#include "mi6b.h"
#include "mi6c.h"
#include "mi6d.h"
#include "mi6e.h"
if (five != 5)
abort ();
return 0;
}
#if IND
#ifdef VAR
VAR++;
#endif
#endif
#if NOT defined (macro)
#ifdef VAR
VAR++;
#endif
#endif
#if !DEFINED
#ifdef VAR
VAR++;
#endif
#endif
#if EMPTY !defined (macro)
#ifdef VAR
VAR++;
#endif
#endif
#if !defined (macro) EMPTY
#ifdef VAR
VAR++;
#endif
#endif
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment