2015-02-11 Richard Biener <rguenther@suse.de>
Backport from mainline
2014-07-24 Marek Polacek <polacek@redhat.com>
PR c/57653
* c-opts.c (c_finish_options): If -imacros is in effect, return.
* c-c++-common/pr57653.c: New test.
* c-c++-common/pr57653.h: New file.
* c-c++-common/pr57653-2.c: New test.
* c-c++-common/pr57653-2.h: New file.
From-SVN: r220615
static void
push_command_line_include (void)
{
+ /* This can happen if disabled by -imacros for example.
+ Punt so that we don't set "<command-line>" as the filename for
+ the header. */
+ if (include_cursor > deferred_count)
+ return;
+
if (!done_preinclude)
{
done_preinclude = true;
+2015-02-11 Richard Biener <rguenther@suse.de>
+
+ Backport from mainline
+ 2014-07-24 Marek Polacek <polacek@redhat.com>
+
+ PR c/57653
+ * c-c++-common/pr57653.c: New test.
+ * c-c++-common/pr57653.h: New file.
+ * c-c++-common/pr57653-2.c: New test.
+ * c-c++-common/pr57653-2.h: New file.
+
2015-02-04 Uros Bizjak <ubizjak@gmail.com>
Backport from mainline
--- /dev/null
+/* { dg-do preprocess } */
+/* { dg-options "-imacros ${srcdir}/c-c++-common/pr57653-2.h" } */
+
+/* Empty. */
--- /dev/null
+/* { dg-do compile } */
+/* { dg-options "-imacros ${srcdir}/c-c++-common/pr57653.h" } */
+
+__attribute__((used)) static const char s[] = F;
+
+/* { dg-final { scan-assembler-not "command-line" } } */
--- /dev/null
+#define F __FILE__