fail_todo_define_default_fn_inline.carbon 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  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.add";
  14. // CHECK:STDERR: ^~~~~~~
  15. default fn G(a: i32, b: i32) -> i32 = "int.add";
  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: %.2: type = assoc_entity_type @Interface, <function> [template]
  22. // CHECK:STDOUT: %.3: <associated <function> in Interface> = assoc_entity element0, @Interface.%F [template]
  23. // CHECK:STDOUT: %.4: <associated <function> in Interface> = assoc_entity element1, @Interface.%G [template]
  24. // CHECK:STDOUT: }
  25. // CHECK:STDOUT:
  26. // CHECK:STDOUT: file {
  27. // CHECK:STDOUT: package: <namespace> = namespace [template] {
  28. // CHECK:STDOUT: .Interface = %Interface.decl
  29. // CHECK:STDOUT: }
  30. // CHECK:STDOUT: %Interface.decl: type = interface_decl @Interface [template = constants.%.1] {}
  31. // CHECK:STDOUT: }
  32. // CHECK:STDOUT:
  33. // CHECK:STDOUT: interface @Interface {
  34. // CHECK:STDOUT: %Self: Interface = bind_symbolic_name Self [symbolic]
  35. // CHECK:STDOUT: %F: <function> = fn_decl @F [template] {}
  36. // CHECK:STDOUT: %.loc12: <associated <function> in Interface> = assoc_entity element0, %F [template = constants.%.3]
  37. // CHECK:STDOUT: %G: <function> = fn_decl @G [template] {
  38. // CHECK:STDOUT: %a.loc17_16.1: i32 = param a
  39. // CHECK:STDOUT: %a.loc17_16.2: i32 = bind_name a, %a.loc17_16.1
  40. // CHECK:STDOUT: %b.loc17_24.1: i32 = param b
  41. // CHECK:STDOUT: %b.loc17_24.2: i32 = bind_name b, %b.loc17_24.1
  42. // CHECK:STDOUT: %return.var: ref i32 = var <return slot>
  43. // CHECK:STDOUT: }
  44. // CHECK:STDOUT: %.loc17: <associated <function> in Interface> = assoc_entity element1, %G [template = constants.%.4]
  45. // CHECK:STDOUT:
  46. // CHECK:STDOUT: !members:
  47. // CHECK:STDOUT: .Self = %Self
  48. // CHECK:STDOUT: .F = %.loc12
  49. // CHECK:STDOUT: .G = %.loc17
  50. // CHECK:STDOUT: witness = (%F, %G)
  51. // CHECK:STDOUT: }
  52. // CHECK:STDOUT:
  53. // CHECK:STDOUT: fn @F() {
  54. // CHECK:STDOUT: !entry:
  55. // CHECK:STDOUT: return
  56. // CHECK:STDOUT: }
  57. // CHECK:STDOUT:
  58. // CHECK:STDOUT: fn @G(@Interface.%a.loc17_16.2: i32, @Interface.%b.loc17_24.2: i32) -> i32 = "int.add";
  59. // CHECK:STDOUT: