redeclaration_introducer.carbon 3.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  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/convert.carbon
  6. // TODO: Add ranges and switch to "--dump-sem-ir-ranges=only".
  7. // EXTRA-ARGS: --dump-sem-ir-ranges=if-present
  8. //
  9. // AUTOUPDATE
  10. // TIP: To test this file alone, run:
  11. // TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/class/redeclaration_introducer.carbon
  12. // TIP: To dump output, run:
  13. // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/class/redeclaration_introducer.carbon
  14. class A;
  15. class B;
  16. class C;
  17. class A {}
  18. base class B {}
  19. abstract class C {}
  20. // CHECK:STDOUT: --- redeclaration_introducer.carbon
  21. // CHECK:STDOUT:
  22. // CHECK:STDOUT: constants {
  23. // CHECK:STDOUT: %A: type = class_type @A [concrete]
  24. // CHECK:STDOUT: %B: type = class_type @B [concrete]
  25. // CHECK:STDOUT: %C: type = class_type @C [concrete]
  26. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
  27. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete]
  28. // CHECK:STDOUT: }
  29. // CHECK:STDOUT:
  30. // CHECK:STDOUT: imports {
  31. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  32. // CHECK:STDOUT: import Core//prelude
  33. // CHECK:STDOUT: import Core//prelude/...
  34. // CHECK:STDOUT: }
  35. // CHECK:STDOUT: }
  36. // CHECK:STDOUT:
  37. // CHECK:STDOUT: file {
  38. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  39. // CHECK:STDOUT: .Core = imports.%Core
  40. // CHECK:STDOUT: .A = %A.decl.loc15
  41. // CHECK:STDOUT: .B = %B.decl.loc16
  42. // CHECK:STDOUT: .C = %C.decl.loc17
  43. // CHECK:STDOUT: }
  44. // CHECK:STDOUT: %Core.import = import Core
  45. // CHECK:STDOUT: %A.decl.loc15: type = class_decl @A [concrete = constants.%A] {} {}
  46. // CHECK:STDOUT: %B.decl.loc16: type = class_decl @B [concrete = constants.%B] {} {}
  47. // CHECK:STDOUT: %C.decl.loc17: type = class_decl @C [concrete = constants.%C] {} {}
  48. // CHECK:STDOUT: %A.decl.loc19: type = class_decl @A [concrete = constants.%A] {} {}
  49. // CHECK:STDOUT: %B.decl.loc20: type = class_decl @B [concrete = constants.%B] {} {}
  50. // CHECK:STDOUT: %C.decl.loc21: type = class_decl @C [concrete = constants.%C] {} {}
  51. // CHECK:STDOUT: }
  52. // CHECK:STDOUT:
  53. // CHECK:STDOUT: class @A {
  54. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness constants.%empty_struct_type [concrete = constants.%complete_type]
  55. // CHECK:STDOUT: complete_type_witness = %complete_type
  56. // CHECK:STDOUT:
  57. // CHECK:STDOUT: !members:
  58. // CHECK:STDOUT: .Self = constants.%A
  59. // CHECK:STDOUT: }
  60. // CHECK:STDOUT:
  61. // CHECK:STDOUT: class @B {
  62. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness constants.%empty_struct_type [concrete = constants.%complete_type]
  63. // CHECK:STDOUT: complete_type_witness = %complete_type
  64. // CHECK:STDOUT:
  65. // CHECK:STDOUT: !members:
  66. // CHECK:STDOUT: .Self = constants.%B
  67. // CHECK:STDOUT: }
  68. // CHECK:STDOUT:
  69. // CHECK:STDOUT: class @C {
  70. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness constants.%empty_struct_type [concrete = constants.%complete_type]
  71. // CHECK:STDOUT: complete_type_witness = %complete_type
  72. // CHECK:STDOUT:
  73. // CHECK:STDOUT: !members:
  74. // CHECK:STDOUT: .Self = constants.%C
  75. // CHECK:STDOUT: }
  76. // CHECK:STDOUT: