diff options
author | Lorry Tar Creator <lorry-tar-importer@baserock.org> | 2015-04-22 10:21:45 +0000 |
---|---|---|
committer | <> | 2015-04-25 21:44:09 +0000 |
commit | f80b5ea1605c9f9408c5aa386ba71c16d918ebbf (patch) | |
tree | bb7eafaa81fc4b8c5c215bc08d517fd158db234a /gcc/testsuite/gcc.dg/pr61861.c | |
parent | c27a97d04853380f1e80525391b3f0d156ed4c84 (diff) | |
download | gcc-tarball-f80b5ea1605c9f9408c5aa386ba71c16d918ebbf.tar.gz |
Imported from /home/lorry/working-area/delta_gcc-tarball/gcc-5.1.0.tar.bz2.gcc-5.1.0
Diffstat (limited to 'gcc/testsuite/gcc.dg/pr61861.c')
-rw-r--r-- | gcc/testsuite/gcc.dg/pr61861.c | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/pr61861.c b/gcc/testsuite/gcc.dg/pr61861.c new file mode 100644 index 0000000000..d9028686e2 --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr61861.c @@ -0,0 +1,37 @@ +/* { dg-do compile } */ +/* { dg-prune-output "expected" } */ + +extern void foo (int); +extern void bar (int, char *); + +#define F __FILE__ /* { dg-error "11:passing argument" } */ +#define T __TIME__ /* { dg-error "11:passing argument" } */ +#define D __DATE__ /* { dg-error "11:passing argument" } */ +#define L __LINE__ /* { dg-error "11:passing argument" } */ + +#define F2 "foo" /* { dg-error "12:passing argument" } */ +#define T2 "foo" /* { dg-error "12:passing argument" } */ +#define D2 "foo" /* { dg-error "12:passing argument" } */ +#define L2 42 /* { dg-error "12:passing argument" } */ + +void +f (void) +{ + foo (__FILE__); /* { dg-error "8:passing argument" } */ + foo (__BASE_FILE__); /* { dg-error "8:passing argument" } */ + foo (__TIME__); /* { dg-error "8:passing argument" } */ + foo (__DATE__); /* { dg-error "8:passing argument" } */ + foo (__TIMESTAMP__); /* { dg-error "8:passing argument" } */ + bar (1, __LINE__); /* { dg-error "11:passing argument" } */ + bar (__COUNTER__, __COUNTER__); /* { dg-error "21:passing argument" } */ + + foo (F); /* { dg-message "8:in expansion of" } */ + foo (T); /* { dg-message "8:in expansion of" } */ + foo (D); /* { dg-message "8:in expansion of" } */ + bar (1, L); /* { dg-message "11:in expansion of" } */ + + foo (F2); /* { dg-message "8:in expansion of" } */ + foo (T2); /* { dg-message "8:in expansion of" } */ + foo (D2); /* { dg-message "8:in expansion of" } */ + bar (1, L2); /* { dg-message "11:in expansion of" } */ +} |