alias_of_alias.carbon 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  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. class C {}
  7. alias a = C;
  8. alias b = a;
  9. alias c = b;
  10. let d: c = {};
  11. // CHECK:STDOUT: --- alias_of_alias.carbon
  12. // CHECK:STDOUT:
  13. // CHECK:STDOUT: constants {
  14. // CHECK:STDOUT: %C: type = class_type @C [template]
  15. // CHECK:STDOUT: %.1: type = struct_type {} [template]
  16. // CHECK:STDOUT: %.2: type = tuple_type () [template]
  17. // CHECK:STDOUT: %.3: type = ptr_type {} [template]
  18. // CHECK:STDOUT: %struct: C = struct_value () [template]
  19. // CHECK:STDOUT: }
  20. // CHECK:STDOUT:
  21. // CHECK:STDOUT: file {
  22. // CHECK:STDOUT: package: <namespace> = namespace [template] {
  23. // CHECK:STDOUT: .C = %C.decl
  24. // CHECK:STDOUT: .a = %a
  25. // CHECK:STDOUT: .b = %b
  26. // CHECK:STDOUT: .c = %c
  27. // CHECK:STDOUT: }
  28. // CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {}
  29. // CHECK:STDOUT: %C.ref: type = name_ref C, %C.decl [template = constants.%C]
  30. // CHECK:STDOUT: %a: type = bind_alias a, %C.decl [template = constants.%C]
  31. // CHECK:STDOUT: %a.ref: type = name_ref a, %a [template = constants.%C]
  32. // CHECK:STDOUT: %b: type = bind_alias b, %a [template = constants.%C]
  33. // CHECK:STDOUT: %b.ref: type = name_ref b, %b [template = constants.%C]
  34. // CHECK:STDOUT: %c: type = bind_alias c, %b [template = constants.%C]
  35. // CHECK:STDOUT: %c.ref: type = name_ref c, %c [template = constants.%C]
  36. // CHECK:STDOUT: %.loc11_13.1: {} = struct_literal ()
  37. // CHECK:STDOUT: %.loc11_13.2: ref C = temporary_storage
  38. // CHECK:STDOUT: %.loc11_13.3: init C = class_init (), %.loc11_13.2 [template = constants.%struct]
  39. // CHECK:STDOUT: %.loc11_13.4: ref C = temporary %.loc11_13.2, %.loc11_13.3
  40. // CHECK:STDOUT: %.loc11_14.1: ref C = converted %.loc11_13.1, %.loc11_13.4
  41. // CHECK:STDOUT: %.loc11_14.2: C = bind_value %.loc11_14.1
  42. // CHECK:STDOUT: %d: C = bind_name d, %.loc11_14.2
  43. // CHECK:STDOUT: }
  44. // CHECK:STDOUT:
  45. // CHECK:STDOUT: class @C {
  46. // CHECK:STDOUT: !members:
  47. // CHECK:STDOUT: .Self = constants.%C
  48. // CHECK:STDOUT: }
  49. // CHECK:STDOUT: