blob: 1a2494c295afb48b8ff43fb908c6221987ed7291 [file] [log] [blame]
// 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 test.conformance;
type TableWithEmptyStruct = table {
1: s EmptyStruct;
};
type XUnionWithEmptyStruct = flexible union {
1: s EmptyStruct;
};
type UnionWithEmptyStruct = strict union {
1: s EmptyStruct;
2: force_alignment_of_8 uint64;
};
type StructWithOptionals = struct {
s EmptyStruct;
s2 box<EmptyStruct>;
t TableWithEmptyStruct;
// nullable tables are not allowed.
xu XUnionWithEmptyStruct;
xu2 XUnionWithEmptyStruct:optional;
u UnionWithEmptyStruct;
u2 UnionWithEmptyStruct:optional;
};
type Uint8Struct = struct {
val uint8;
};
type Uint16Struct = struct {
val uint16;
};
type Uint32Struct = struct {
val uint32;
};
type Uint64Struct = struct {
val uint64;
};
type OutOfLinePaddingZeroed7 = struct {
a box<Uint8Struct>;
b box<Uint64Struct>;
};
type OutOfLinePaddingZeroed6 = struct {
a box<Uint16Struct>;
b box<Uint64Struct>;
};
type OutOfLinePaddingZeroed4 = struct {
a box<Uint32Struct>;
b box<Uint64Struct>;
};