forward_decl.carbon 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  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. // TIP: To test this file alone, run:
  7. // TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/function/generic/no_prelude/forward_decl.carbon
  8. // TIP: To dump output, run:
  9. // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/function/generic/no_prelude/forward_decl.carbon
  10. fn F(T:! type);
  11. // CHECK:STDOUT: --- forward_decl.carbon
  12. // CHECK:STDOUT:
  13. // CHECK:STDOUT: constants {
  14. // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic]
  15. // CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic]
  16. // CHECK:STDOUT: %F.type: type = fn_type @F [template]
  17. // CHECK:STDOUT: %.1: type = tuple_type () [template]
  18. // CHECK:STDOUT: %F: %F.type = struct_value () [template]
  19. // CHECK:STDOUT: }
  20. // CHECK:STDOUT:
  21. // CHECK:STDOUT: file {
  22. // CHECK:STDOUT: package: <namespace> = namespace [template] {
  23. // CHECK:STDOUT: .F = %F.decl
  24. // CHECK:STDOUT: }
  25. // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {
  26. // CHECK:STDOUT: %T.patt.loc11_6.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc11_6.2 (constants.%T.patt)]
  27. // CHECK:STDOUT: %T.param_patt: type = value_param_pattern %T.patt.loc11_6.1, runtime_param<invalid> [symbolic = %T.patt.loc11_6.2 (constants.%T.patt)]
  28. // CHECK:STDOUT: } {
  29. // CHECK:STDOUT: %T.param: type = value_param runtime_param<invalid>
  30. // CHECK:STDOUT: %T.loc11_6.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc11_6.2 (constants.%T)]
  31. // CHECK:STDOUT: }
  32. // CHECK:STDOUT: }
  33. // CHECK:STDOUT:
  34. // CHECK:STDOUT: generic fn @F(%T.loc11_6.1: type) {
  35. // CHECK:STDOUT: %T.loc11_6.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc11_6.2 (constants.%T)]
  36. // CHECK:STDOUT: %T.patt.loc11_6.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc11_6.2 (constants.%T.patt)]
  37. // CHECK:STDOUT:
  38. // CHECK:STDOUT: fn(%T.param_patt: type);
  39. // CHECK:STDOUT: }
  40. // CHECK:STDOUT:
  41. // CHECK:STDOUT: specific @F(constants.%T) {
  42. // CHECK:STDOUT: %T.loc11_6.2 => constants.%T
  43. // CHECK:STDOUT: %T.patt.loc11_6.2 => constants.%T
  44. // CHECK:STDOUT: }
  45. // CHECK:STDOUT: