From 69836943050e738b9305250da19d1f2723d47998 Mon Sep 17 00:00:00 2001 From: "Matt McCutchen (Correct Computation)" Date: Sat, 19 Jun 2021 21:23:34 -0400 Subject: [PATCH] Follow new guideline: Avoid `cd DIR && FOO` in RUN lines. Instead, put `FOO` on a separate run line. `cd` affects later RUN lines, and `cd DIR && FOO` could mislead the reader that it doesn't and that's why we needed to put both parts on one line. I added the proposed guideline to #346. I'm changing the existing tests before changing more tests to use `cd` as part of this PR. --- clang/test/3C/base_subdir/canwrite_constraints.c | 5 +++-- clang/test/3C/base_subdir/canwrite_constraints_symlink.c | 3 ++- .../test/3C/base_subdir/canwrite_constraints_unimplemented.c | 3 ++- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/clang/test/3C/base_subdir/canwrite_constraints.c b/clang/test/3C/base_subdir/canwrite_constraints.c index b5ff5884c32e..cdba5a2cd391 100644 --- a/clang/test/3C/base_subdir/canwrite_constraints.c +++ b/clang/test/3C/base_subdir/canwrite_constraints.c @@ -10,14 +10,15 @@ // not allow canwrite_constraints.h to change, and the internal types of q and // the return should remain wild. // -// RUN: cd %S && 3c -alltypes -addcr -output-dir=%t.checked/base_subdir -warn-all-root-cause %s -- -Xclang -verify +// RUN: cd %S +// RUN: 3c -alltypes -addcr -output-dir=%t.checked/base_subdir -warn-all-root-cause %s -- -Xclang -verify // RUN: FileCheck -match-full-lines -check-prefixes=CHECK_LOWER --input-file %t.checked/base_subdir/canwrite_constraints.c %s // RUN: test ! -f %t.checked/canwrite_constraints.checked.h // "Higher" case: When -base-dir is set to the parent directory, we can change // canwrite_constraints.h, so both q and the return should become checked. // -// RUN: cd %S && 3c -alltypes -addcr -base-dir=.. -output-dir=%t.checked2 %s -- +// RUN: 3c -alltypes -addcr -base-dir=.. -output-dir=%t.checked2 %s -- // RUN: FileCheck -match-full-lines -check-prefixes=CHECK_HIGHER --input-file %t.checked2/base_subdir/canwrite_constraints.c %s // RUN: FileCheck -match-full-lines -check-prefixes=CHECK_HIGHER --input-file %t.checked2/canwrite_constraints.h %S/../canwrite_constraints.h diff --git a/clang/test/3C/base_subdir/canwrite_constraints_symlink.c b/clang/test/3C/base_subdir/canwrite_constraints_symlink.c index 86f9091b4606..c538ab9886e1 100644 --- a/clang/test/3C/base_subdir/canwrite_constraints_symlink.c +++ b/clang/test/3C/base_subdir/canwrite_constraints_symlink.c @@ -20,7 +20,8 @@ // Now 3C should know that it can't write to base_subdir_partial_defn.h because // the symlink goes out of the base dir. // -// RUN: cd %t.base && 3c -addcr canwrite_constraints_symlink.c -- -Xclang -verify +// RUN: cd %t.base +// RUN: 3c -addcr canwrite_constraints_symlink.c -- -Xclang -verify // expected-error@base_subdir_partial_defn.h:1 {{3C internal error: 3C generated changes to this file even though it is not allowed to write to the file}} // expected-note@*:* {{-dump-unwritable-changes}} diff --git a/clang/test/3C/base_subdir/canwrite_constraints_unimplemented.c b/clang/test/3C/base_subdir/canwrite_constraints_unimplemented.c index 694ecf48e57b..706f4607e8ac 100644 --- a/clang/test/3C/base_subdir/canwrite_constraints_unimplemented.c +++ b/clang/test/3C/base_subdir/canwrite_constraints_unimplemented.c @@ -3,7 +3,8 @@ // an error diagnostic. // (https://github.com/correctcomputation/checkedc-clang/issues/387) -// RUN: cd %S && 3c -addcr %s -- -Xclang -verify +// RUN: cd %S +// RUN: 3c -addcr %s -- -Xclang -verify // expected-error@../base_subdir_partial_defn.h:1 {{3C internal error: 3C generated changes to this file even though it is not allowed to write to the file}} // expected-note@*:* {{-dump-unwritable-changes}}