[PATCH] D130089: update-test-checks: safely handle tests with #if's

Nicolai Hähnle via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Jul 21 03:40:06 PDT 2022


nhaehnle added a comment.

In D130089#3666076 <https://reviews.llvm.org/D130089#3666076>, @mizvekov wrote:

> This seems to have introduced a test which always fails on windows:
>
>   $ ":" "RUN: at line 4"
>   $ "cp" "clang\test\utils\update_cc_test_checks/Inputs/ifdef.c" "build\llvm\tools\clang\test\utils\update_cc_test_checks\Output\ifdef.test.tmp.c"
>   $ "C:/Program Files (x86)/Microsoft Visual Studio/Shared/Python39_64/python.exe" "llvm\utils\update_cc_test_checks.py" "--clang" "build\llvm\RelWithDebInfo\bin\clang" "--opt" "build\llvm\RelWithDebInfo\bin\opt" "build\llvm\tools\clang\test\utils\update_cc_test_checks\Output\ifdef.test.tmp.c"
>   $ ":" "RUN: at line 5"
>   $ "diff" "-u" "clang\test\utils\update_cc_test_checks/Inputs/ifdef.c.expected" "build\llvm\tools\clang\test\utils\update_cc_test_checks\Output\ifdef.test.tmp.c"
>   # command output:
>   --- clang\test\utils\update_cc_test_checks/Inputs/ifdef.c.expected
>   +++ build\llvm\tools\clang\test\utils\update_cc_test_checks\Output\ifdef.test.tmp.c
>   @@ -1,21 +1,21 @@
>   -// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py
>   -// RUN: %clang_cc1 -triple=x86_64-unknown-linux-gnu -emit-llvm -o - %s | FileCheck -check-prefixes=CHECK %s
>   -// RUN: %clang_cc1 -triple=x86_64-unknown-linux-gnu -emit-llvm -o - %s -DFOO | FileCheck -check-prefixes=CHECK,FOO %s
>   -
>   -#ifdef FOO
>   -// FOO-LABEL: @foo(
>   -// FOO-NEXT:  entry:
>   -// FOO-NEXT:    ret i32 1
>   -//
>   -int foo() {
>   -  return 1;
>   -}
>   -#endif
>   -
>   -// CHECK-LABEL: @bar(
>   -// CHECK-NEXT:  entry:
>   -// CHECK-NEXT:    ret i32 2
>   -//
>   -int bar() {
>   -  return 2;
>   -}
>   +// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py
>   +// RUN: %clang_cc1 -triple=x86_64-unknown-linux-gnu -emit-llvm -o - %s | FileCheck -check-prefixes=CHECK %s
>   +// RUN: %clang_cc1 -triple=x86_64-unknown-linux-gnu -emit-llvm -o - %s -DFOO | FileCheck -check-prefixes=CHECK,FOO %s
>   +
>   +#ifdef FOO
>   +// FOO-LABEL: @foo(
>   +// FOO-NEXT:  entry:
>   +// FOO-NEXT:    ret i32 1
>   +//
>   +int foo() {
>   +  return 1;
>   +}
>   +#endif
>   +
>   +// CHECK-LABEL: @bar(
>   +// CHECK-NEXT:  entry:
>   +// CHECK-NEXT:    ret i32 2
>   +//
>   +int bar() {
>   +  return 2;
>   +}
>   
>   error: command failed with exit status: 1
>   
>   --
>   
>   ********************
>   Testing:  0.. 10.. 20.. 30.. 40.. 50.. 60.. 70.. 80.. 90..
>   ********************
>   Failed Tests (1):
>     Clang :: utils/update_cc_test_checks/ifdef.test
>   
>   
>   Testing Time: 0.28s
>     Failed: 1

Aren't the before and after lines of the diff identical? Is this a Windows new-lines issue?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D130089/new/

https://reviews.llvm.org/D130089



More information about the cfe-commits mailing list