fail_missing_cond.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. fn F() {
  7. // CHECK:STDERR: fail_missing_cond.carbon:[[@LINE+3]]:6: Expected `(` after `if`.
  8. // CHECK:STDERR: if {
  9. // CHECK:STDERR: ^
  10. if {
  11. }
  12. }
  13. // CHECK:STDOUT: [
  14. // CHECK:STDOUT: {kind: 'FunctionIntroducer', text: 'fn'},
  15. // CHECK:STDOUT: {kind: 'Name', text: 'F'},
  16. // CHECK:STDOUT: {kind: 'ParameterListStart', text: '('},
  17. // CHECK:STDOUT: {kind: 'ParameterList', text: ')', subtree_size: 2},
  18. // CHECK:STDOUT: {kind: 'FunctionDefinitionStart', text: '{', subtree_size: 5},
  19. // CHECK:STDOUT: {kind: 'IfConditionStart', text: 'if', has_error: yes},
  20. // CHECK:STDOUT: {kind: 'InvalidParse', text: '{', has_error: yes},
  21. // CHECK:STDOUT: {kind: 'IfCondition', text: 'if', has_error: yes, subtree_size: 3},
  22. // CHECK:STDOUT: {kind: 'CodeBlockStart', text: '{'},
  23. // CHECK:STDOUT: {kind: 'CodeBlock', text: '}', subtree_size: 2},
  24. // CHECK:STDOUT: {kind: 'IfStatement', text: 'if', subtree_size: 6},
  25. // CHECK:STDOUT: {kind: 'FunctionDefinition', text: '}', subtree_size: 12},
  26. // CHECK:STDOUT: {kind: 'FileEnd', text: ''},
  27. // CHECK:STDOUT: ]