| // Copyright 2019 The Fuchsia Authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| |
| // This is intended to ensure that the GIDL-generated test code produces the |
| // correct syntax for C++ bindings, which needs to distinguish between e.g. |
| // using "Foo foo;" vs "std::unique_ptr<Foo> foo;" for optional (nullable) |
| // fields, "object.foo()" vs "object->foo()" vs "object.set_foo()", etc. |
| |
| library conformance; |
| |
| table TableWithEmptyStruct { |
| 1: EmptyStruct s; |
| }; |
| |
| flexible union XUnionWithEmptyStruct { |
| 1: EmptyStruct s; |
| }; |
| |
| union UnionWithEmptyStruct { |
| 1: EmptyStruct s; |
| 2: uint64 force_alignment_of_8; |
| }; |
| |
| struct StructWithOptionals { |
| EmptyStruct s; |
| EmptyStruct? s2; |
| TableWithEmptyStruct t; |
| // nullable tables are not allowed. |
| XUnionWithEmptyStruct xu; |
| XUnionWithEmptyStruct? xu2; |
| UnionWithEmptyStruct u; |
| UnionWithEmptyStruct? u2; |
| }; |
| |
| struct Uint8Struct { |
| uint8 val; |
| }; |
| |
| struct Uint16Struct { |
| uint16 val; |
| }; |
| |
| struct Uint32Struct { |
| uint32 val; |
| }; |
| |
| struct Uint64Struct { |
| uint64 val; |
| }; |
| |
| struct OutOfLinePaddingZeroed7 { |
| Uint8Struct? a; |
| Uint64Struct? b; |
| }; |
| |
| struct OutOfLinePaddingZeroed6 { |
| Uint16Struct? a; |
| Uint64Struct? b; |
| }; |
| |
| struct OutOfLinePaddingZeroed4 { |
| Uint32Struct? a; |
| Uint64Struct? b; |
| }; |