[foreign-jextract] RFR: 8252759: Jextract flattens nested anonymous structs and unions when computing layouts [v3]

Jorn Vernee jvernee at openjdk.java.net
Fri Jan 15 14:38:36 UTC 2021


On Fri, 15 Jan 2021 12:22:35 GMT, Maurizio Cimadamore <mcimadamore at openjdk.org> wrote:

>> Note that we already have a test that more broadly tests nested structs; https://github.com/openjdk/panama-foreign/blob/foreign-jextract/test/jdk/tools/jextract/nested.h
>> 
>> It just wasn't catching this particular case, so I added something separate. I can enhance that test to also check offsets of fields.
>
>> Note that we already have a test that more broadly tests nested structs; https://github.com/openjdk/panama-foreign/blob/foreign-jextract/test/jdk/tools/jextract/nested.h
>> 
>> It just wasn't catching this particular case, so I added something separate. I can enhance that test to also check offsets of fields.
> 
> Yes, but that test is super simple:
> https://github.com/openjdk/panama-foreign/blob/foreign-jextract/test/jdk/tools/jextract/Test8244512.java
> 
> (unless I'm missing something).
> 
> I'd suggest to unify both test and verify the emitted layouts (and field accessors too), not just the classes that come out. I'm also ok if we do that as a separate change.

I've unified the two tests, and expanded the existing test of nested structs to also verify field offsets and accessors.

-------------

PR: https://git.openjdk.java.net/panama-foreign/pull/434


More information about the panama-dev mailing list