empty_struct.carbon 1.0 KB

123456789101112131415161718192021222324252627282930
  1. // Part of the Carbon Language project, under the Apache License v2.0 with LLVM
  2. // Exceptions. See /LICENSE for license information.
  3. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  4. //
  5. // AUTOUPDATE
  6. // CHECK:STDOUT: ; ModuleID = 'empty_struct.carbon'
  7. // CHECK:STDOUT: source_filename = "empty_struct.carbon"
  8. // CHECK:STDOUT:
  9. // CHECK:STDOUT: %EmptyTupleType = type {}
  10. // CHECK:STDOUT: %StructLiteralType = type {}
  11. // CHECK:STDOUT:
  12. // CHECK:STDOUT: define %EmptyTupleType @Echo(%StructLiteralType %a) {
  13. // CHECK:STDOUT: entry:
  14. // CHECK:STDOUT: }
  15. // CHECK:STDOUT:
  16. // CHECK:STDOUT: define %EmptyTupleType @Main() {
  17. // CHECK:STDOUT: entry:
  18. // CHECK:STDOUT: %StructLiteralValue = alloca %StructLiteralType, align 8
  19. // CHECK:STDOUT: %0 = load %StructLiteralType, ptr %StructLiteralValue, align 1
  20. // CHECK:STDOUT: %Echo = call %EmptyTupleType @Echo(%StructLiteralType %0)
  21. // CHECK:STDOUT: }
  22. fn Echo(a: {}) {
  23. // TODO: Set return type to `{}` and return `a` back.
  24. }
  25. fn Main() {
  26. // TODO: Store the returned `{}`.
  27. Echo({});
  28. }