public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* Option flag with string arguments
@ 2019-12-19 21:47 Erick Ochoa
  2019-12-19 22:01 ` Jozef Lawrynowicz
  2019-12-19 22:06 ` David Malcolm
  0 siblings, 2 replies; 4+ messages in thread
From: Erick Ochoa @ 2019-12-19 21:47 UTC (permalink / raw)
  To: GCC Development; +Cc: Christoph Müllner, Dr. Philipp Tomsich

Hello,

I am working on testing an optimization. I am starting to write
tests in the GCC testing suite. However, I want to develop some
fine grain testing for my own sake.

This optimization I am working on, is a variant of struct reordering.
One way I would like to test my pass is for example, making a test case
and guaranteeing that my pass is able to detect global variables of
a specific struct type.

For example, given the following C file

```
/* { dg-lto-options {{-flto -fipa-struct-reorg -fipa-struct-reorg-assert-has-structs=astruct_s}} } */

struct astruct_s { _Bool a; };
struct astruct_s astruct;

int main() { };
```

I would like to create the option flag that has a list of string arguments

-fipa-struct-reorg-assert-has-structs=<string>+

such that during the analysis time, I'd be able to have an assertion
to make sure that my pass has actually collected the types identified by the
strings.
I'm not very familiar on the DSL to specify option flags.
I've looked at gcc/common.opt for some examples and found this one:

```
frandom-seed=
Common Joined RejectNegative Var(common_deferred_options) Defer
-frandom-seed=<string>  Make compile reproducible using <string>.
```

Could anyone explain how to specify my flag? Or possibly
point to some documentation/source that explains Common, Joined, etc...?

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-12-19 22:06 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-19 21:47 Option flag with string arguments Erick Ochoa
2019-12-19 22:01 ` Jozef Lawrynowicz
2019-12-19 22:05   ` Erick Ochoa
2019-12-19 22:06 ` David Malcolm

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).