This is the mail archive of the gcc@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: What command does dg-test generate?


Lawrence Crowl <crowl@google.com> writes:

> Inside a C++ .exp file, I want to know the compiler command that
> would be executed for a given dg-test command.  That is, given
>
>     set dg-do-what-default compile
>     dg-test -keep-output $source "$options -I." ""
>
> what is a command that I can execute to compile the source file
> without dejagnu trying to interpret it as a test?
>
> It might be sufficient if I just knew the path to the compiler.
>
> Any ideas?

Welcome to DejaGNU, a horrible program which should be removed from
reality and sent to spend a thousand lifetimes as a servant to the elder
gods.  The cruel ones.

That said, you can try something along the lines of

  global target_triplet
  set comp_output [g++_target_compile "source.c" "source.o" "object" ""]
  set comp_output [g++-dg-prune $target_triplet $comp_output]
  if [string match "" $comp_output] {
    # Success!
  } else {
    # failure....
    verbose -log $comp_output
  }

Ian


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