Once a symbol has its address taken, a lot of simplifications must be avoided because the symbol can now be modified via a pointer. This is currently done but the symbol addressability does not take in account the fact that a symbol can be accessed via one of its subfields. Add a testcase to illustrate this. Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@xxxxxxxxx> --- validation/eval/addressable-complex.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 validation/eval/addressable-complex.c diff --git a/validation/eval/addressable-complex.c b/validation/eval/addressable-complex.c new file mode 100644 index 000000000000..62ab59f04cf9 --- /dev/null +++ b/validation/eval/addressable-complex.c @@ -0,0 +1,24 @@ +extern void def(void *); + +struct s1 { + int a; +}; + +int use1(void) +{ + struct s1 s = { 3 }; + + def(&s.a); + + return s.a; +} + +/* + * check-name: eval/addressable-complex + * check-command: test-linearize -Wno-decl -fdump-ir $file + * check-known-to-fail + * + * check-output-ignore + * check-output-contains: load\\. + * check-output-excludes: return\\..*\\$3 + */ -- 2.24.0