| // Copyright 2022 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. |
| |
| library test.conformance; |
| |
| type EmptyStruct = struct {}; |
| |
| // This struct intentionally starts with the letter 'A' |
| // so that it will appear in the IR before EmptyStruct. |
| // This tests that each backend generates bindings compatible |
| // with declarations in arbitrary order. |
| type AnEmptyStructInStruct = struct { |
| v EmptyStruct; |
| }; |
| |
| type TwoEmptyStructsInStruct = struct { |
| a EmptyStruct; |
| b EmptyStruct; |
| }; |
| |
| type EmptyStructsInArrayInStruct = struct { |
| v array<EmptyStruct, 4>; |
| }; |
| |
| type EmptyStructsInVectorInStruct = struct { |
| v vector<EmptyStruct>; |
| }; |
| |
| type TwoEmptyStructsInStructInVectorInStruct = struct { |
| v vector<TwoEmptyStructsInStruct>; |
| }; |
| |
| type OptionalEmptyStructWrapper = struct { |
| s box<EmptyStruct>; |
| }; |
| |
| type RecursiveEmptyStruct = struct { |
| inner box<RecursiveEmptyStruct>; |
| }; |
| |
| // Wrap with an extra layer of struct and array which should not add any more |
| // out of line recursion depth. |
| type RecursiveEmptyStructArrayWrapper = struct { |
| arr array<RecursiveEmptyStruct, 1>; |
| }; |
| |
| type RecursiveEmptyStructVectorWrapper = struct { |
| vec vector<RecursiveEmptyStruct>; |
| }; |