fail_todo_define_default_fn_inline.carbon 2.7 KB

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