[clang] d4959b5 - [Driver] Fix tests not to fail randomly on Windows

Paul Robinson via cfe-commits cfe-commits at lists.llvm.org
Wed Dec 21 09:37:19 PST 2022


Author: Paul Robinson
Date: 2022-12-21T09:37:12-08:00
New Revision: d4959b5a4bb888789f99a952a1304ce915dfee2f

URL: https://github.com/llvm/llvm-project/commit/d4959b5a4bb888789f99a952a1304ce915dfee2f
DIFF: https://github.com/llvm/llvm-project/commit/d4959b5a4bb888789f99a952a1304ce915dfee2f.diff

LOG: [Driver] Fix tests not to fail randomly on Windows

These used a regex that didn't guard against backslashes, so
getting "lucky" with a temp dir name could make them fail.

Added: 
    

Modified: 
    clang/test/Driver/freebsd.c
    clang/test/Driver/fuchsia.c
    clang/test/Driver/netbsd.c
    clang/test/Driver/openbsd.c

Removed: 
    


################################################################################
diff  --git a/clang/test/Driver/freebsd.c b/clang/test/Driver/freebsd.c
index 87ce46d1c1c6e..a9afff22ae848 100644
--- a/clang/test/Driver/freebsd.c
+++ b/clang/test/Driver/freebsd.c
@@ -212,5 +212,5 @@
 // RELOCATABLE:     "-r"
 // RELOCATABLE-NOT: "-dynamic-linker"
 // RELOCATABLE-NOT: "-l
-// RELOCATABLE-NOT: crt{{[^./]+}}.o
+// RELOCATABLE-NOT: crt{{[^./\\]+}}.o
 

diff  --git a/clang/test/Driver/fuchsia.c b/clang/test/Driver/fuchsia.c
index 339fd92309796..9c023329edb5f 100644
--- a/clang/test/Driver/fuchsia.c
+++ b/clang/test/Driver/fuchsia.c
@@ -89,7 +89,7 @@
 // CHECK-RELOCATABLE-NOT "-dynamic-linker"
 // CHECK-RELOCATABLE: "-r"
 // CHECK-RELOCATABLE-NOT: "-l
-// CHECK-RELOCATABLE-NOT: crt{{[^./]+}}.o
+// CHECK-RELOCATABLE-NOT: crt{{[^./\\]+}}.o
 
 // RUN: %clang -### %s --target=x86_64-unknown-fuchsia -nodefaultlibs -fuse-ld=lld 2>&1 \
 // RUN:     -resource-dir=%S/Inputs/resource_dir_with_per_target_subdir \

diff  --git a/clang/test/Driver/netbsd.c b/clang/test/Driver/netbsd.c
index 436772ab99795..52f3a33198059 100644
--- a/clang/test/Driver/netbsd.c
+++ b/clang/test/Driver/netbsd.c
@@ -476,4 +476,4 @@
 // RELOCATABLE-NOT: "-pie"
 // RELOCATABLE-NOT: "-dynamic-linker"
 // RELOCATABLE-NOT: "-l
-// RELOCATABLE-NOT: crt{{[^./]+}}.o
+// RELOCATABLE-NOT: crt{{[^./\\]+}}.o

diff  --git a/clang/test/Driver/openbsd.c b/clang/test/Driver/openbsd.c
index 3ba8a315f6e16..05d290a309c40 100644
--- a/clang/test/Driver/openbsd.c
+++ b/clang/test/Driver/openbsd.c
@@ -39,7 +39,7 @@
 // CHECK-LD-R:     "-r"
 // CHECK-LD-R-NOT: "-dynamic-linker"
 // CHECK-LD-R-NOT: "-l
-// CHECK-LD-R-NOT: crt{{[^./]+}}.o
+// CHECK-LD-R-NOT: crt{{[^./\\]+}}.o
 // CHECK-LD-S: "-cc1" "-triple" "i686-pc-openbsd"
 // CHECK-LD-S: ld{{.*}}" "-e" "__start" "--eh-frame-hdr" "-Bdynamic" "-dynamic-linker" "{{.*}}ld.so" "-o" "a.out" "{{.*}}crt0.o" "{{.*}}crtbegin.o" "-L{{.*}}" "-s" "{{.*}}.o" "-lcompiler_rt" "-lc" "-lcompiler_rt" "{{.*}}crtend.o"
 // CHECK-LD-T: "-cc1" "-triple" "i686-pc-openbsd"


        


More information about the cfe-commits mailing list