fail_todo_define_default_fn_inline.carbon 3.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  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 Interface {
  7. // CHECK:STDERR: fail_todo_define_default_fn_inline.carbon:[[@LINE+4]]:3: ERROR: Semantics TODO: `interface modifier`.
  8. // CHECK:STDERR: default fn F() {}
  9. // CHECK:STDERR: ^~~~~~~
  10. // CHECK:STDERR:
  11. default fn F() {}
  12. // CHECK:STDERR: fail_todo_define_default_fn_inline.carbon:[[@LINE+3]]:3: ERROR: Semantics TODO: `interface modifier`.
  13. // CHECK:STDERR: default fn G(a: i32, b: i32) -> i32 = "int.sadd";
  14. // CHECK:STDERR: ^~~~~~~
  15. default fn G(a: i32, b: i32) -> i32 = "int.sadd";
  16. }
  17. // CHECK:STDOUT: --- fail_todo_define_default_fn_inline.carbon
  18. // CHECK:STDOUT:
  19. // CHECK:STDOUT: constants {
  20. // CHECK:STDOUT: %.1: type = interface_type @Interface [template]
  21. // CHECK:STDOUT: %Self: Interface = bind_symbolic_name Self 0 [symbolic]
  22. // CHECK:STDOUT: %F: type = fn_type @F [template]
  23. // CHECK:STDOUT: %.2: type = tuple_type () [template]
  24. // CHECK:STDOUT: %struct.1: F = struct_value () [template]
  25. // CHECK:STDOUT: %.3: type = assoc_entity_type @Interface, F [template]
  26. // CHECK:STDOUT: %.4: <associated F in Interface> = assoc_entity element0, @Interface.%F.decl [template]
  27. // CHECK:STDOUT: %G: type = fn_type @G [template]
  28. // CHECK:STDOUT: %struct.2: G = struct_value () [template]
  29. // CHECK:STDOUT: %.5: type = assoc_entity_type @Interface, G [template]
  30. // CHECK:STDOUT: %.6: <associated G in Interface> = assoc_entity element1, @Interface.%G.decl [template]
  31. // CHECK:STDOUT: }
  32. // CHECK:STDOUT:
  33. // CHECK:STDOUT: file {
  34. // CHECK:STDOUT: package: <namespace> = namespace [template] {
  35. // CHECK:STDOUT: .Core = %Core
  36. // CHECK:STDOUT: .Interface = %Interface.decl
  37. // CHECK:STDOUT: }
  38. // CHECK:STDOUT: %Core: <namespace> = namespace [template] {}
  39. // CHECK:STDOUT: %Interface.decl: type = interface_decl @Interface [template = constants.%.1] {}
  40. // CHECK:STDOUT: }
  41. // CHECK:STDOUT:
  42. // CHECK:STDOUT: interface @Interface {
  43. // CHECK:STDOUT: %Self: Interface = bind_symbolic_name Self 0 [symbolic = constants.%Self]
  44. // CHECK:STDOUT: %F.decl: F = fn_decl @F [template = constants.%struct.1] {}
  45. // CHECK:STDOUT: %.loc12: <associated F in Interface> = assoc_entity element0, %F.decl [template = constants.%.4]
  46. // CHECK:STDOUT: %G.decl: G = fn_decl @G [template = constants.%struct.2] {
  47. // CHECK:STDOUT: %a.loc17_16.1: i32 = param a
  48. // CHECK:STDOUT: %a.loc17_16.2: i32 = bind_name a, %a.loc17_16.1
  49. // CHECK:STDOUT: %b.loc17_24.1: i32 = param b
  50. // CHECK:STDOUT: %b.loc17_24.2: i32 = bind_name b, %b.loc17_24.1
  51. // CHECK:STDOUT: %return.var: ref i32 = var <return slot>
  52. // CHECK:STDOUT: }
  53. // CHECK:STDOUT: %.loc17: <associated G in Interface> = assoc_entity element1, %G.decl [template = constants.%.6]
  54. // CHECK:STDOUT:
  55. // CHECK:STDOUT: !members:
  56. // CHECK:STDOUT: .Self = %Self
  57. // CHECK:STDOUT: .F = %.loc12
  58. // CHECK:STDOUT: .G = %.loc17
  59. // CHECK:STDOUT: witness = (%F.decl, %G.decl)
  60. // CHECK:STDOUT: }
  61. // CHECK:STDOUT:
  62. // CHECK:STDOUT: fn @F() {
  63. // CHECK:STDOUT: !entry:
  64. // CHECK:STDOUT: return
  65. // CHECK:STDOUT: }
  66. // CHECK:STDOUT:
  67. // CHECK:STDOUT: fn @G(@Interface.%a.loc17_16.2: i32, @Interface.%b.loc17_24.2: i32) -> i32 = "int.sadd";
  68. // CHECK:STDOUT: