fail_precedence_star_minus.carbon 1.2 KB

12345678910111213141516171819202122
  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. // RUN: %{not} %{carbon-run-parser}
  7. // CHECK:STDOUT: [
  8. // CHECK:STDOUT: {kind: 'VariableIntroducer', text: 'var'},
  9. // CHECK:STDOUT: {kind: 'DeclaredName', text: 'n'},
  10. // CHECK:STDOUT: {kind: 'Literal', text: 'i8'},
  11. // CHECK:STDOUT: {kind: 'PatternBinding', text: ':', subtree_size: 3},
  12. // CHECK:STDOUT: {kind: 'VariableInitializer', text: '='},
  13. // CHECK:STDOUT: {kind: 'NameReference', text: 'n'},
  14. // CHECK:STDOUT: {kind: 'PostfixOperator', text: '*', subtree_size: 2},
  15. // CHECK:STDOUT: {kind: 'NameReference', text: 'n'},
  16. // CHECK:STDOUT: {kind: 'InfixOperator', text: '-', has_error: yes, subtree_size: 4},
  17. // CHECK:STDOUT: {kind: 'VariableDeclaration', text: ';', subtree_size: 10},
  18. // CHECK:STDOUT: {kind: 'FileEnd', text: ''},
  19. // CHECK:STDOUT: ]
  20. // CHECK:STDERR: {{.*}}/toolchain/parser/testdata/operators/fail_precedence_star_minus.carbon:[[@LINE+1]]:16: Parentheses are required to disambiguate operator precedence.
  21. var n: i8 = n* -n;