diff mbox

PATCH: PR driver/47547: WHOPR, can't use /dev/null as an output file

Message ID AANLkTinr=1TQMw0t=UuQOKudN46y8tY9MSY3D7n=LRRe@mail.gmail.com
State New
Headers show

Commit Message

Diego Novillo Jan. 31, 2011, 8:28 p.m. UTC
On Mon, Jan 31, 2011 at 15:22, H.J. Lu <hjl.tools@gmail.com> wrote:

> In the meantime, is that OK without a testcase?

I'd rather have a testcase, since it doesn't really seem all that
hard.  Could you check if this does what I think it should?


Thanks.  Diego.

Comments

H.J. Lu Jan. 31, 2011, 9:41 p.m. UTC | #1
On Mon, Jan 31, 2011 at 12:28 PM, Diego Novillo <dnovillo@google.com> wrote:
> On Mon, Jan 31, 2011 at 15:22, H.J. Lu <hjl.tools@gmail.com> wrote:
>
>> In the meantime, is that OK without a testcase?
>
> I'd rather have a testcase, since it doesn't really seem all that
> hard.  Could you check if this does what I think it should?
>
>
> Thanks.  Diego.
>
>
> Index: testsuite/lib/lto.exp
> ===================================================================
> --- testsuite/lib/lto.exp       (revision 168468)
> +++ testsuite/lib/lto.exp       (working copy)
> @@ -295,6 +295,8 @@ proc lto-get-options-main { src } {
>                set compile_type "run"
>            } elseif { ![string compare "link" $dgdo] } {
>                set compile_type "link"
> +           } elseif { ![string compare "compile-null" $dgdo] } {
> +               set compile_type "compile-null"
>            } else {
>                warning "lto.exp does not support dg-lto-do $dgdo"
>            }
> Index: testsuite/lib/gcc-dg.exp
> ===================================================================
> --- testsuite/lib/gcc-dg.exp    (revision 168468)
> +++ testsuite/lib/gcc-dg.exp    (working copy)
> @@ -114,6 +114,10 @@ proc gcc-dg-test-1 { target_compile prog
>            set compile_type "assembly"
>            set output_file "[file rootname [file tail $prog]].s"
>        }
> +       "compile-null" {
> +           set compile_type "assembly"
> +           set output_file "/dev/null"
> +       }
>        "assemble" {
>            set compile_type "object"
>            set output_file "[file rootname [file tail $prog]].o"
>

It doesn't work:

[hjl@gnu-6 gcc.dg]$ cat pr47547.c
/* { dg-do compile-null } */
/* { dg-options "-O2 -fdump-tree-optimized" } */

int
main ()
{
  return 0;
}

/* { dg-final { cleanup-tree-dump "optimized" } } */
[hjl@gnu-6 gcc.dg]$

[hjl@gnu-6 gcc]$ make check-gcc
RUNTESTFLAGS="--target_board='unix{-m32,}' dg.exp=pr47547.c"
...
Running /export/gnu/import/git/gcc/gcc/testsuite/gcc.dg/dg.exp ...
ERROR: gcc.dg/pr47547.c: 1: syntax error for " dg-do 1 compile-null "
..
H.J. Lu Jan. 31, 2011, 9:43 p.m. UTC | #2
On Mon, Jan 31, 2011 at 1:41 PM, H.J. Lu <hjl.tools@gmail.com> wrote:
> On Mon, Jan 31, 2011 at 12:28 PM, Diego Novillo <dnovillo@google.com> wrote:
>> On Mon, Jan 31, 2011 at 15:22, H.J. Lu <hjl.tools@gmail.com> wrote:
>>
>>> In the meantime, is that OK without a testcase?
>>
>> I'd rather have a testcase, since it doesn't really seem all that
>> hard.  Could you check if this does what I think it should?
>>
>>
>> Thanks.  Diego.
>>
>>
>> Index: testsuite/lib/lto.exp
>> ===================================================================
>> --- testsuite/lib/lto.exp       (revision 168468)
>> +++ testsuite/lib/lto.exp       (working copy)
>> @@ -295,6 +295,8 @@ proc lto-get-options-main { src } {
>>                set compile_type "run"
>>            } elseif { ![string compare "link" $dgdo] } {
>>                set compile_type "link"
>> +           } elseif { ![string compare "compile-null" $dgdo] } {
>> +               set compile_type "compile-null"
>>            } else {
>>                warning "lto.exp does not support dg-lto-do $dgdo"
>>            }
>> Index: testsuite/lib/gcc-dg.exp
>> ===================================================================
>> --- testsuite/lib/gcc-dg.exp    (revision 168468)
>> +++ testsuite/lib/gcc-dg.exp    (working copy)
>> @@ -114,6 +114,10 @@ proc gcc-dg-test-1 { target_compile prog
>>            set compile_type "assembly"
>>            set output_file "[file rootname [file tail $prog]].s"
>>        }
>> +       "compile-null" {
>> +           set compile_type "assembly"
>> +           set output_file "/dev/null"
>> +       }
>>        "assemble" {
>>            set compile_type "object"
>>            set output_file "[file rootname [file tail $prog]].o"
>>
>
> It doesn't work:
>
> [hjl@gnu-6 gcc.dg]$ cat pr47547.c
> /* { dg-do compile-null } */
> /* { dg-options "-O2 -fdump-tree-optimized" } */
>
> int
> main ()
> {
>  return 0;
> }
>
> /* { dg-final { cleanup-tree-dump "optimized" } } */
> [hjl@gnu-6 gcc.dg]$
>
> [hjl@gnu-6 gcc]$ make check-gcc
> RUNTESTFLAGS="--target_board='unix{-m32,}' dg.exp=pr47547.c"
> ...
> Running /export/gnu/import/git/gcc/gcc/testsuite/gcc.dg/dg.exp ...
> ERROR: gcc.dg/pr47547.c: 1: syntax error for " dg-do 1 compile-null "
> ..

From /usr/share/dejagnu/dg.exp:

    switch [lindex $args 1] {
        "preprocess" { }
        "compile" { }
        "assemble" { }
        "link" { }
        "run" { }
        default {
            error "[lindex $args 0]: syntax error"
        }
    }

You can't add compile-null in gcc.
Diego Novillo Feb. 1, 2011, 2:32 p.m. UTC | #3
On Mon, Jan 31, 2011 at 16:43, H.J. Lu <hjl.tools@gmail.com> wrote:

> You can't add compile-null in gcc.

Sigh.  I had forgotten about that.  Thanks for testing it.

Patch is OK, with Dave's correction.


Diego.
diff mbox

Patch

Index: testsuite/lib/lto.exp
===================================================================
--- testsuite/lib/lto.exp       (revision 168468)
+++ testsuite/lib/lto.exp       (working copy)
@@ -295,6 +295,8 @@  proc lto-get-options-main { src } {
                set compile_type "run"
            } elseif { ![string compare "link" $dgdo] } {
                set compile_type "link"
+           } elseif { ![string compare "compile-null" $dgdo] } {
+               set compile_type "compile-null"
            } else {
                warning "lto.exp does not support dg-lto-do $dgdo"
            }
Index: testsuite/lib/gcc-dg.exp
===================================================================
--- testsuite/lib/gcc-dg.exp    (revision 168468)
+++ testsuite/lib/gcc-dg.exp    (working copy)
@@ -114,6 +114,10 @@  proc gcc-dg-test-1 { target_compile prog
            set compile_type "assembly"
            set output_file "[file rootname [file tail $prog]].s"
        }
+       "compile-null" {
+           set compile_type "assembly"
+           set output_file "/dev/null"
+       }
        "assemble" {
            set compile_type "object"
            set output_file "[file rootname [file tail $prog]].o"