member_inline.carbon 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  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(T:! type) {
  7. fn F(n: T) -> T {
  8. return n;
  9. }
  10. }
  11. // CHECK:STDOUT: --- member_inline.carbon
  12. // CHECK:STDOUT:
  13. // CHECK:STDOUT: constants {
  14. // CHECK:STDOUT: %T: type = bind_symbolic_name T 0 [symbolic]
  15. // CHECK:STDOUT: %Class: type = class_type @Class [template]
  16. // CHECK:STDOUT: %F: type = fn_type @F [template]
  17. // CHECK:STDOUT: %.1: type = tuple_type () [template]
  18. // CHECK:STDOUT: %struct: F = struct_value () [template]
  19. // CHECK:STDOUT: %.2: type = struct_type {} [template]
  20. // CHECK:STDOUT: }
  21. // CHECK:STDOUT:
  22. // CHECK:STDOUT: file {
  23. // CHECK:STDOUT: package: <namespace> = namespace [template] {
  24. // CHECK:STDOUT: .Core = %Core
  25. // CHECK:STDOUT: .Class = %Class.decl
  26. // CHECK:STDOUT: }
  27. // CHECK:STDOUT: %Core: <namespace> = namespace [template] {}
  28. // CHECK:STDOUT: %Class.decl: type = class_decl @Class [template = constants.%Class] {
  29. // CHECK:STDOUT: %T.loc7_13.1: type = param T
  30. // CHECK:STDOUT: %T.loc7_13.2: type = bind_symbolic_name T 0, %T.loc7_13.1 [symbolic = constants.%T]
  31. // CHECK:STDOUT: }
  32. // CHECK:STDOUT: }
  33. // CHECK:STDOUT:
  34. // CHECK:STDOUT: class @Class {
  35. // CHECK:STDOUT: %F.decl: F = fn_decl @F [template = constants.%struct] {
  36. // CHECK:STDOUT: %T.ref.loc8_11: type = name_ref T, file.%T.loc7_13.2 [symbolic = constants.%T]
  37. // CHECK:STDOUT: %n.loc8_8.1: T = param n
  38. // CHECK:STDOUT: %n.loc8_8.2: T = bind_name n, %n.loc8_8.1
  39. // CHECK:STDOUT: %T.ref.loc8_17: type = name_ref T, file.%T.loc7_13.2 [symbolic = constants.%T]
  40. // CHECK:STDOUT: %return.var: ref T = var <return slot>
  41. // CHECK:STDOUT: }
  42. // CHECK:STDOUT:
  43. // CHECK:STDOUT: !members:
  44. // CHECK:STDOUT: .Self = constants.%Class
  45. // CHECK:STDOUT: .F = %F.decl
  46. // CHECK:STDOUT: }
  47. // CHECK:STDOUT:
  48. // CHECK:STDOUT: fn @F(@Class.%n.loc8_8.2: T) -> T {
  49. // CHECK:STDOUT: !entry:
  50. // CHECK:STDOUT: %n.ref: T = name_ref n, @Class.%n.loc8_8.2
  51. // CHECK:STDOUT: return %n.ref
  52. // CHECK:STDOUT: }
  53. // CHECK:STDOUT: