two_entries.carbon 990 B

123456789101112131415161718192021222324252627
  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 = 'toolchain/lowering/testdata/struct/two_entries.carbon'
  7. // CHECK:STDOUT: source_filename = "toolchain/lowering/testdata/struct/two_entries.carbon"
  8. // CHECK:STDOUT:
  9. // CHECK:STDOUT: %0 = type { i32, i32 }
  10. // CHECK:STDOUT: %1 = type { i32, i32 }
  11. // CHECK:STDOUT: %2 = type { i32, i32 }
  12. // CHECK:STDOUT:
  13. // CHECK:STDOUT: define i32 @Run() {
  14. // CHECK:STDOUT: entry:
  15. // CHECK:STDOUT: %0 = alloca %0, align 8
  16. // CHECK:STDOUT: %1 = alloca %1, align 8
  17. // CHECK:STDOUT: store ptr %1, ptr %0, align 8
  18. // CHECK:STDOUT: %2 = alloca %2, align 8
  19. // CHECK:STDOUT: store ptr %0, ptr %2, align 8
  20. // CHECK:STDOUT: ret i32 0
  21. // CHECK:STDOUT: }
  22. fn Run() -> i32 {
  23. var x: {.a: i32, .b: i32} = {.a = 1, .b = 2};
  24. var y: {.a: i32, .b: i32} = x;
  25. return 0;
  26. }