forward_decl.carbon 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  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: %pattern_type: type = pattern_type type [concrete]
  16. // CHECK:STDOUT: %F.type: type = fn_type @F [concrete]
  17. // CHECK:STDOUT: %F: %F.type = struct_value () [concrete]
  18. // CHECK:STDOUT: }
  19. // CHECK:STDOUT:
  20. // CHECK:STDOUT: file {
  21. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  22. // CHECK:STDOUT: .F = %F.decl
  23. // CHECK:STDOUT: }
  24. // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [concrete = constants.%F] {
  25. // CHECK:STDOUT: %T.patt: %pattern_type = symbolic_binding_pattern T, 0 [concrete]
  26. // CHECK:STDOUT: } {
  27. // CHECK:STDOUT: %T.loc11_6.1: type = bind_symbolic_name T, 0 [symbolic = %T.loc11_6.2 (constants.%T)]
  28. // CHECK:STDOUT: }
  29. // CHECK:STDOUT: }
  30. // CHECK:STDOUT:
  31. // CHECK:STDOUT: generic fn @F(%T.loc11_6.1: type) {
  32. // CHECK:STDOUT: %T.loc11_6.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc11_6.2 (constants.%T)]
  33. // CHECK:STDOUT:
  34. // CHECK:STDOUT: fn();
  35. // CHECK:STDOUT: }
  36. // CHECK:STDOUT:
  37. // CHECK:STDOUT: specific @F(constants.%T) {
  38. // CHECK:STDOUT: %T.loc11_6.2 => constants.%T
  39. // CHECK:STDOUT: }
  40. // CHECK:STDOUT: