This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


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.


-- 
H.J.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]