assoc_const.carbon 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  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. interface I {
  7. let T:! type;
  8. let N:! i32;
  9. }
  10. // CHECK:STDOUT: --- assoc_const.carbon
  11. // CHECK:STDOUT:
  12. // CHECK:STDOUT: constants {
  13. // CHECK:STDOUT: %.1: type = interface_type @I [template]
  14. // CHECK:STDOUT: %Self: I = bind_symbolic_name Self 0 [symbolic]
  15. // CHECK:STDOUT: %.2: type = assoc_entity_type @I, type [template]
  16. // CHECK:STDOUT: %.3: <associated type in I> = assoc_entity element0, @I.%T [template]
  17. // CHECK:STDOUT: %.4: type = assoc_entity_type @I, i32 [template]
  18. // CHECK:STDOUT: %.5: <associated i32 in I> = assoc_entity element1, @I.%N [template]
  19. // CHECK:STDOUT: }
  20. // CHECK:STDOUT:
  21. // CHECK:STDOUT: file {
  22. // CHECK:STDOUT: package: <namespace> = namespace [template] {
  23. // CHECK:STDOUT: .Core = %Core
  24. // CHECK:STDOUT: .I = %I.decl
  25. // CHECK:STDOUT: }
  26. // CHECK:STDOUT: %Core: <namespace> = namespace [template] {}
  27. // CHECK:STDOUT: %I.decl: type = interface_decl @I [template = constants.%.1] {}
  28. // CHECK:STDOUT: }
  29. // CHECK:STDOUT:
  30. // CHECK:STDOUT: interface @I {
  31. // CHECK:STDOUT: %Self: I = bind_symbolic_name Self 0 [symbolic = constants.%Self]
  32. // CHECK:STDOUT: %T: type = assoc_const_decl T [template]
  33. // CHECK:STDOUT: %.loc8: <associated type in I> = assoc_entity element0, %T [template = constants.%.3]
  34. // CHECK:STDOUT: %N: i32 = assoc_const_decl N [template]
  35. // CHECK:STDOUT: %.loc9: <associated i32 in I> = assoc_entity element1, %N [template = constants.%.5]
  36. // CHECK:STDOUT:
  37. // CHECK:STDOUT: !members:
  38. // CHECK:STDOUT: .Self = %Self
  39. // CHECK:STDOUT: .T = %.loc8
  40. // CHECK:STDOUT: .N = %.loc9
  41. // CHECK:STDOUT: witness = (%T, %N)
  42. // CHECK:STDOUT: }
  43. // CHECK:STDOUT: