fail_after_package.carbon 1.2 KB

1234567891011121314151617181920212223242526
  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. package A api;
  7. // CHECK:STDERR: fail_after_package.carbon:[[@LINE+6]]:1: ERROR: The `package` directive must be the first non-comment line.
  8. // CHECK:STDERR: package B api;
  9. // CHECK:STDERR: ^~~~~~~
  10. // CHECK:STDERR: fail_after_package.carbon:[[@LINE-4]]:1: First non-comment line is here.
  11. // CHECK:STDERR: package A api;
  12. // CHECK:STDERR: ^~~~~~~
  13. package B api;
  14. // CHECK:STDOUT: - filename: fail_after_package.carbon
  15. // CHECK:STDOUT: parse_tree: [
  16. // CHECK:STDOUT: {kind: 'FileStart', text: ''},
  17. // CHECK:STDOUT: {kind: 'PackageIntroducer', text: 'package'},
  18. // CHECK:STDOUT: {kind: 'PackageName', text: 'A'},
  19. // CHECK:STDOUT: {kind: 'PackageApi', text: 'api'},
  20. // CHECK:STDOUT: {kind: 'PackageDirective', text: ';', subtree_size: 4},
  21. // CHECK:STDOUT: {kind: 'PackageIntroducer', text: 'package'},
  22. // CHECK:STDOUT: {kind: 'PackageDirective', text: ';', has_error: yes, subtree_size: 2},
  23. // CHECK:STDOUT: {kind: 'FileEnd', text: ''},
  24. // CHECK:STDOUT: ]