redeclaration.carbon 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  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 Class;
  7. class Class {
  8. fn F[self: Self](b: bool);
  9. }
  10. fn Class.F[self: Self](b: bool) {}
  11. // CHECK:STDOUT: --- redeclaration.carbon
  12. // CHECK:STDOUT:
  13. // CHECK:STDOUT: constants {
  14. // CHECK:STDOUT: %Class: type = class_type @Class [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: }
  19. // CHECK:STDOUT:
  20. // CHECK:STDOUT: file {
  21. // CHECK:STDOUT: package: <namespace> = namespace [template] {
  22. // CHECK:STDOUT: .Core = %Core
  23. // CHECK:STDOUT: .Class = %Class.decl.loc7
  24. // CHECK:STDOUT: }
  25. // CHECK:STDOUT: %Core: <namespace> = namespace [template] {}
  26. // CHECK:STDOUT: %Class.decl.loc7: type = class_decl @Class [template = constants.%Class] {}
  27. // CHECK:STDOUT: %Class.decl.loc9: type = class_decl @Class [template = constants.%Class] {}
  28. // CHECK:STDOUT: %F: <function> = fn_decl @F [template] {
  29. // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%Class [template = constants.%Class]
  30. // CHECK:STDOUT: %self.loc13_12.1: Class = param self
  31. // CHECK:STDOUT: @F.%self: Class = bind_name self, %self.loc13_12.1
  32. // CHECK:STDOUT: %b.loc13_24.1: bool = param b
  33. // CHECK:STDOUT: @F.%b: bool = bind_name b, %b.loc13_24.1
  34. // CHECK:STDOUT: }
  35. // CHECK:STDOUT: }
  36. // CHECK:STDOUT:
  37. // CHECK:STDOUT: class @Class {
  38. // CHECK:STDOUT: %F: <function> = fn_decl @F [template] {
  39. // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%Class [template = constants.%Class]
  40. // CHECK:STDOUT: %self.loc10_8.1: Class = param self
  41. // CHECK:STDOUT: %self.loc10_8.2: Class = bind_name self, %self.loc10_8.1
  42. // CHECK:STDOUT: %b.loc10_20.1: bool = param b
  43. // CHECK:STDOUT: %b.loc10_20.2: bool = bind_name b, %b.loc10_20.1
  44. // CHECK:STDOUT: }
  45. // CHECK:STDOUT:
  46. // CHECK:STDOUT: !members:
  47. // CHECK:STDOUT: .Self = constants.%Class
  48. // CHECK:STDOUT: .F = %F
  49. // CHECK:STDOUT: }
  50. // CHECK:STDOUT:
  51. // CHECK:STDOUT: fn @F[%self: Class](%b: bool) {
  52. // CHECK:STDOUT: !entry:
  53. // CHECK:STDOUT: return
  54. // CHECK:STDOUT: }
  55. // CHECK:STDOUT: