aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/cpp/cmdlne-dD-M.c
blob: 1a0adc025c2ad3b5f13728fc0a29877abb2af2ad (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
/* Copyright (C) 2002 Free Software Foundation, Inc.  */

/* { dg-do preprocess } */
/* { dg-options "-dD -M" } */

/* Test -dD -M does not fail.  It should print just
   the Makefile rule with dependencies.  */

#define foo bar
#define funlike(like) fun like
int variable;

/* { dg-final { if ![file exists cmdlne-dD-M.i] { return }                } }
   { dg-final { if { [grep cmdlne-dD-M.i "^#define foo bar$"] != "" } { fail "cmdlne-dD-M.c: #define line printed" } } }
   { dg-final { if { [grep cmdlne-dD-M.i "variable"] != "" } { fail "cmdlne-dD-M.c: non-#define line printed" } } }
   { dg-final { if { [grep cmdlne-dD-M.i "^cmdlne-dD-M.*:.*cmdlne-dD-M.c"] == "" } { xfail "cmdlne-dD-M.c: dependency rule not printed" } } }
   { dg-final { return } }  */