in_namespace.carbon 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  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. namespace NS;
  7. alias NS.a = bool;
  8. let b: NS.a = false;
  9. fn F() -> NS.a {
  10. return false;
  11. }
  12. // CHECK:STDOUT: --- in_namespace.carbon
  13. // CHECK:STDOUT:
  14. // CHECK:STDOUT: constants {
  15. // CHECK:STDOUT: %.1: bool = bool_literal false [template]
  16. // CHECK:STDOUT: }
  17. // CHECK:STDOUT:
  18. // CHECK:STDOUT: file {
  19. // CHECK:STDOUT: package: <namespace> = namespace {
  20. // CHECK:STDOUT: .NS = %.loc7
  21. // CHECK:STDOUT: .F = %F
  22. // CHECK:STDOUT: } [template]
  23. // CHECK:STDOUT: %.loc7: <namespace> = namespace {
  24. // CHECK:STDOUT: .a = %a
  25. // CHECK:STDOUT: } [template]
  26. // CHECK:STDOUT: %a: type = bind_alias a, bool [template = bool]
  27. // CHECK:STDOUT: %NS.ref.loc10: <namespace> = name_ref NS, %.loc7 [template = %.loc7]
  28. // CHECK:STDOUT: %a.ref.loc10: type = name_ref a, %a [template = bool]
  29. // CHECK:STDOUT: %.loc10: bool = bool_literal false [template = constants.%.1]
  30. // CHECK:STDOUT: %b: bool = bind_name b, %.loc10
  31. // CHECK:STDOUT: %F: <function> = fn_decl @F {
  32. // CHECK:STDOUT: %NS.ref.loc12: <namespace> = name_ref NS, %.loc7 [template = %.loc7]
  33. // CHECK:STDOUT: %a.ref.loc12: type = name_ref a, %a [template = bool]
  34. // CHECK:STDOUT: %return.var: ref bool = var <return slot>
  35. // CHECK:STDOUT: } [template]
  36. // CHECK:STDOUT: }
  37. // CHECK:STDOUT:
  38. // CHECK:STDOUT: fn @F() -> bool {
  39. // CHECK:STDOUT: !entry:
  40. // CHECK:STDOUT: %.loc13: bool = bool_literal false [template = constants.%.1]
  41. // CHECK:STDOUT: return %.loc13
  42. // CHECK:STDOUT: }
  43. // CHECK:STDOUT: