fail_too_late.carbon 1.1 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. import Geometry;
  7. // CHECK:STDERR: fail_too_late.carbon:[[@LINE+6]]:1: ERROR: The `library` directive must be the first non-comment line.
  8. // CHECK:STDERR: library "Shapes" api;
  9. // CHECK:STDERR: ^~~~~~~
  10. // CHECK:STDERR: fail_too_late.carbon:[[@LINE-5]]:1: First non-comment line is here.
  11. // CHECK:STDERR: import Geometry;
  12. // CHECK:STDERR: ^~~~~~
  13. library "Shapes" api;
  14. // CHECK:STDOUT: - filename: fail_too_late.carbon
  15. // CHECK:STDOUT: parse_tree: [
  16. // CHECK:STDOUT: {kind: 'FileStart', text: ''},
  17. // CHECK:STDOUT: {kind: 'ImportIntroducer', text: 'import'},
  18. // CHECK:STDOUT: {kind: 'PackageName', text: 'Geometry'},
  19. // CHECK:STDOUT: {kind: 'ImportDirective', text: ';', subtree_size: 3},
  20. // CHECK:STDOUT: {kind: 'LibraryIntroducer', text: 'library'},
  21. // CHECK:STDOUT: {kind: 'LibraryDirective', text: ';', has_error: yes, subtree_size: 2},
  22. // CHECK:STDOUT: {kind: 'FileEnd', text: ''},
  23. // CHECK:STDOUT: ]