redeclaration_introducer.carbon 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  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. // TIP: To test this file alone, run:
  7. // TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/class/redeclaration_introducer.carbon
  8. // TIP: To dump output, run:
  9. // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/class/redeclaration_introducer.carbon
  10. class A;
  11. class B;
  12. class C;
  13. class A {}
  14. base class B {}
  15. abstract class C {}
  16. // CHECK:STDOUT: --- redeclaration_introducer.carbon
  17. // CHECK:STDOUT:
  18. // CHECK:STDOUT: constants {
  19. // CHECK:STDOUT: %A: type = class_type @A [template]
  20. // CHECK:STDOUT: %B: type = class_type @B [template]
  21. // CHECK:STDOUT: %C: type = class_type @C [template]
  22. // CHECK:STDOUT: %.1: type = struct_type {} [template]
  23. // CHECK:STDOUT: %.2: <witness> = complete_type_witness %.1 [template]
  24. // CHECK:STDOUT: }
  25. // CHECK:STDOUT:
  26. // CHECK:STDOUT: imports {
  27. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [template] {
  28. // CHECK:STDOUT: import Core//prelude
  29. // CHECK:STDOUT: import Core//prelude/operators
  30. // CHECK:STDOUT: import Core//prelude/types
  31. // CHECK:STDOUT: import Core//prelude/operators/arithmetic
  32. // CHECK:STDOUT: import Core//prelude/operators/as
  33. // CHECK:STDOUT: import Core//prelude/operators/bitwise
  34. // CHECK:STDOUT: import Core//prelude/operators/comparison
  35. // CHECK:STDOUT: import Core//prelude/types/bool
  36. // CHECK:STDOUT: }
  37. // CHECK:STDOUT: }
  38. // CHECK:STDOUT:
  39. // CHECK:STDOUT: file {
  40. // CHECK:STDOUT: package: <namespace> = namespace [template] {
  41. // CHECK:STDOUT: .Core = imports.%Core
  42. // CHECK:STDOUT: .A = %A.decl.loc11
  43. // CHECK:STDOUT: .B = %B.decl.loc12
  44. // CHECK:STDOUT: .C = %C.decl.loc13
  45. // CHECK:STDOUT: }
  46. // CHECK:STDOUT: %Core.import = import Core
  47. // CHECK:STDOUT: %A.decl.loc11: type = class_decl @A [template = constants.%A] {} {}
  48. // CHECK:STDOUT: %B.decl.loc12: type = class_decl @B [template = constants.%B] {} {}
  49. // CHECK:STDOUT: %C.decl.loc13: type = class_decl @C [template = constants.%C] {} {}
  50. // CHECK:STDOUT: %A.decl.loc15: type = class_decl @A [template = constants.%A] {} {}
  51. // CHECK:STDOUT: %B.decl.loc16: type = class_decl @B [template = constants.%B] {} {}
  52. // CHECK:STDOUT: %C.decl.loc17: type = class_decl @C [template = constants.%C] {} {}
  53. // CHECK:STDOUT: }
  54. // CHECK:STDOUT:
  55. // CHECK:STDOUT: class @A {
  56. // CHECK:STDOUT: %.loc15: <witness> = complete_type_witness %.1 [template = constants.%.2]
  57. // CHECK:STDOUT:
  58. // CHECK:STDOUT: !members:
  59. // CHECK:STDOUT: .Self = constants.%A
  60. // CHECK:STDOUT: }
  61. // CHECK:STDOUT:
  62. // CHECK:STDOUT: class @B {
  63. // CHECK:STDOUT: %.loc16: <witness> = complete_type_witness %.1 [template = constants.%.2]
  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: %.loc17: <witness> = complete_type_witness %.1 [template = constants.%.2]
  71. // CHECK:STDOUT:
  72. // CHECK:STDOUT: !members:
  73. // CHECK:STDOUT: .Self = constants.%C
  74. // CHECK:STDOUT: }
  75. // CHECK:STDOUT: