assert.carbon 815 B

123456789101112131415161718192021
  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. // This won't auto-update because it uses a regex for the prelude line number,
  6. // so that it doesn't need to be updated on every prelude change.
  7. //
  8. // RUN: %{not} %{explorer} %s 2>&1 | \
  9. // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes=false %s
  10. // RUN: %{not} %{explorer} --parser_debug --trace_file=- %s 2>&1 | \
  11. // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes %s
  12. // NOAUTOUPDATE
  13. // CHECK: RUNTIME ERROR: {{.*}}/explorer/data/prelude.carbon:{{.*}}: "HALLO WELT"
  14. package ExplorerTest api;
  15. fn Main() -> i32 {
  16. Assert(true, "HALLO WELT");
  17. Assert(false, "HALLO WELT");
  18. return 0;
  19. }