fail_invalid_alternative_identifier.carbon 1.3 KB

1234567891011121314151617181920212223242526272829
  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. choice InvalidAlternativeIdentifier {
  7. // CHECK:STDERR: fail_invalid_alternative_identifier.carbon:[[@LINE+4]]:5: ERROR: Expected choice alternative name.
  8. // CHECK:STDERR: ,Some,
  9. // CHECK:STDERR: ^
  10. // CHECK:STDERR:
  11. ,Some,
  12. // CHECK:STDERR: fail_invalid_alternative_identifier.carbon:[[@LINE+3]]:5: ERROR: Expected choice alternative name.
  13. // CHECK:STDERR: 42,
  14. // CHECK:STDERR: ^~
  15. 42,
  16. Other
  17. }
  18. // CHECK:STDOUT: - filename: fail_invalid_alternative_identifier.carbon
  19. // CHECK:STDOUT: parse_tree: [
  20. // CHECK:STDOUT: {kind: 'FileStart', text: ''},
  21. // CHECK:STDOUT: {kind: 'ChoiceIntroducer', text: 'choice'},
  22. // CHECK:STDOUT: {kind: 'IdentifierName', text: 'InvalidAlternativeIdentifier'},
  23. // CHECK:STDOUT: {kind: 'ChoiceDefinitionStart', text: '{', subtree_size: 3},
  24. // CHECK:STDOUT: {kind: 'IdentifierName', text: 'Other'},
  25. // CHECK:STDOUT: {kind: 'ChoiceDefinition', text: '}', has_error: yes, subtree_size: 5},
  26. // CHECK:STDOUT: {kind: 'FileEnd', text: ''},
  27. // CHECK:STDOUT: ]