empty_struct.carbon 1003 B

1234567891011121314151617181920212223242526272829303132
  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. fn Echo(a: {}) -> {} {
  7. return {};
  8. }
  9. fn Main() {
  10. var b: {} = Echo({});
  11. }
  12. // CHECK:STDOUT: ; ModuleID = 'empty_struct.carbon'
  13. // CHECK:STDOUT: source_filename = "empty_struct.carbon"
  14. // CHECK:STDOUT:
  15. // CHECK:STDOUT: define {} @Echo({} %a) {
  16. // CHECK:STDOUT: %struct = alloca {}, align 8
  17. // CHECK:STDOUT: %1 = load {}, ptr %struct, align 1
  18. // CHECK:STDOUT: ret {} %1
  19. // CHECK:STDOUT: }
  20. // CHECK:STDOUT:
  21. // CHECK:STDOUT: define void @Main() {
  22. // CHECK:STDOUT: %struct = alloca {}, align 8
  23. // CHECK:STDOUT: %b = alloca {}, align 8
  24. // CHECK:STDOUT: %struct1 = alloca {}, align 8
  25. // CHECK:STDOUT: %1 = load {}, ptr %struct1, align 1
  26. // CHECK:STDOUT: %Echo = call {} @Echo({} %1)
  27. // CHECK:STDOUT: store {} %Echo, ptr %b, align 1
  28. // CHECK:STDOUT: ret void
  29. // CHECK:STDOUT: }