local.carbon 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  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. // INCLUDE-FILE: toolchain/testing/testdata/min_prelude/destroy.carbon
  6. //
  7. // AUTOUPDATE
  8. // TIP: To test this file alone, run:
  9. // TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/alias/local.carbon
  10. // TIP: To dump output, run:
  11. // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/alias/local.carbon
  12. // --- local.carbon
  13. library "[[@TEST_NAME]]";
  14. fn F() -> () {
  15. var a: () = ();
  16. //@dump-sem-ir-begin
  17. alias b = a;
  18. //@dump-sem-ir-end
  19. return b;
  20. }
  21. // CHECK:STDOUT: --- local.carbon
  22. // CHECK:STDOUT:
  23. // CHECK:STDOUT: constants {
  24. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
  25. // CHECK:STDOUT: }
  26. // CHECK:STDOUT:
  27. // CHECK:STDOUT: imports {
  28. // CHECK:STDOUT: }
  29. // CHECK:STDOUT:
  30. // CHECK:STDOUT: fn @F() -> %empty_tuple.type {
  31. // CHECK:STDOUT: !entry:
  32. // CHECK:STDOUT: <elided>
  33. // CHECK:STDOUT: %a.ref: ref %empty_tuple.type = name_ref a, %a
  34. // CHECK:STDOUT: %b: ref %empty_tuple.type = alias_binding b, %a
  35. // CHECK:STDOUT: <elided>
  36. // CHECK:STDOUT: }
  37. // CHECK:STDOUT: