redeclaration.carbon 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  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. impl i32 as I;
  8. class X {
  9. impl i32 as I;
  10. }
  11. impl i32 as I {}
  12. // CHECK:STDOUT: --- redeclaration.carbon
  13. // CHECK:STDOUT:
  14. // CHECK:STDOUT: constants {
  15. // CHECK:STDOUT: %.1: type = interface_type @I [template]
  16. // CHECK:STDOUT: %X: type = class_type @X [template]
  17. // CHECK:STDOUT: %.2: type = struct_type {} [template]
  18. // CHECK:STDOUT: %.3: <witness> = interface_witness () [template]
  19. // CHECK:STDOUT: }
  20. // CHECK:STDOUT:
  21. // CHECK:STDOUT: file {
  22. // CHECK:STDOUT: package: <namespace> = namespace [template] {
  23. // CHECK:STDOUT: .I = %I.decl
  24. // CHECK:STDOUT: .X = %X.decl
  25. // CHECK:STDOUT: }
  26. // CHECK:STDOUT: %I.decl: type = interface_decl @I [template = constants.%.1] {}
  27. // CHECK:STDOUT: impl_decl @impl {
  28. // CHECK:STDOUT: %I.ref.loc9: type = name_ref I, %I.decl [template = constants.%.1]
  29. // CHECK:STDOUT: }
  30. // CHECK:STDOUT: %X.decl: type = class_decl @X [template = constants.%X] {}
  31. // CHECK:STDOUT: impl_decl @impl {
  32. // CHECK:STDOUT: %I.ref.loc15: type = name_ref I, %I.decl [template = constants.%.1]
  33. // CHECK:STDOUT: }
  34. // CHECK:STDOUT: }
  35. // CHECK:STDOUT:
  36. // CHECK:STDOUT: interface @I {
  37. // CHECK:STDOUT: %Self: I = bind_symbolic_name Self [symbolic]
  38. // CHECK:STDOUT:
  39. // CHECK:STDOUT: !members:
  40. // CHECK:STDOUT: .Self = %Self
  41. // CHECK:STDOUT: witness = ()
  42. // CHECK:STDOUT: }
  43. // CHECK:STDOUT:
  44. // CHECK:STDOUT: impl @impl: i32 as I {
  45. // CHECK:STDOUT: %.1: <witness> = interface_witness () [template = constants.%.3]
  46. // CHECK:STDOUT:
  47. // CHECK:STDOUT: !members:
  48. // CHECK:STDOUT: witness = %.1
  49. // CHECK:STDOUT: }
  50. // CHECK:STDOUT:
  51. // CHECK:STDOUT: class @X {
  52. // CHECK:STDOUT: impl_decl @impl {
  53. // CHECK:STDOUT: %I.ref: type = name_ref I, file.%I.decl [template = constants.%.1]
  54. // CHECK:STDOUT: }
  55. // CHECK:STDOUT:
  56. // CHECK:STDOUT: !members:
  57. // CHECK:STDOUT: .Self = constants.%X
  58. // CHECK:STDOUT: }
  59. // CHECK:STDOUT: