dump_sem_ir_ranges_only.carbon 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  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. // This tests `--dump-sem-ir-range=only` behavior, which is set implicitly by
  6. // file_test.
  7. //
  8. // INCLUDE-FILE: toolchain/testing/testdata/min_prelude/none.carbon
  9. //
  10. // AUTOUPDATE
  11. // TIP: To test this file alone, run:
  12. // TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/basics/dump_sem_ir_ranges_only.carbon
  13. // TIP: To dump output, run:
  14. // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/basics/dump_sem_ir_ranges_only.carbon
  15. // --- with-range.carbon
  16. library "[[@TEST_NAME]]";
  17. //@dump-sem-ir-begin
  18. fn F();
  19. //@dump-sem-ir-end
  20. // --- without-range.carbon
  21. library "[[@TEST_NAME]]";
  22. fn F();
  23. // --- explicit_dump_file.carbon
  24. library "[[@TEST_NAME]]";
  25. //@include-in-dumps
  26. // CHECK:STDOUT: --- with-range.carbon
  27. // CHECK:STDOUT:
  28. // CHECK:STDOUT: constants {
  29. // CHECK:STDOUT: %F.type: type = fn_type @F [concrete]
  30. // CHECK:STDOUT: %F: %F.type = struct_value () [concrete]
  31. // CHECK:STDOUT: }
  32. // CHECK:STDOUT:
  33. // CHECK:STDOUT: file {
  34. // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [concrete = constants.%F] {} {}
  35. // CHECK:STDOUT: }
  36. // CHECK:STDOUT:
  37. // CHECK:STDOUT: fn @F();
  38. // CHECK:STDOUT:
  39. // CHECK:STDOUT: --- explicit_dump_file.carbon
  40. // CHECK:STDOUT:
  41. // CHECK:STDOUT: file {
  42. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {}
  43. // CHECK:STDOUT: }
  44. // CHECK:STDOUT: