[clang] 9d3dbcd - [Driver] Move -print-runtime-dir and -print-resource-dir tests

Petr Hosek via cfe-commits cfe-commits at lists.llvm.org
Wed May 5 15:24:01 PDT 2021


Author: Petr Hosek
Date: 2021-05-05T15:23:49-07:00
New Revision: 9d3dbcd24c7d61e83fe5b3c4e7b7e4ecf9d70cd7

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

LOG: [Driver] Move -print-runtime-dir and -print-resource-dir tests

Put these into a separate files to match other -print-* options tests.

Differential Revision: https://reviews.llvm.org/D101813

Added: 
    clang/test/Driver/print-resource-dir.c
    clang/test/Driver/print-runtime-dir.c

Modified: 
    clang/test/Driver/immediate-options.c

Removed: 
    


################################################################################
diff  --git a/clang/test/Driver/immediate-options.c b/clang/test/Driver/immediate-options.c
index c398e0d41c6e..77878fe2e9c5 100644
--- a/clang/test/Driver/immediate-options.c
+++ b/clang/test/Driver/immediate-options.c
@@ -12,20 +12,3 @@
 
 // RUN: %clang -dumpversion | FileCheck %s -check-prefix=DUMPVERSION
 // DUMPVERSION: {{[0-9]+\.[0-9.]+}}
-
-// Test if the -print-resource-dir option is accepted without error.
-// Allow unspecified output because the value of CLANG_RESOURCE_DIR is unknown.
-// RUN: %clang -print-resource-dir | FileCheck %s -check-prefix=PRINT-RESOURCE-DIR
-// PRINT-RESOURCE-DIR: {{.+}}
-
-// Default resource-dir layout
-// RUN: %clang -print-runtime-dir --target=x86_64-pc-windows-msvc \
-// RUN:        -resource-dir=%S/Inputs/resource_dir \
-// RUN:      | FileCheck --check-prefix=PRINT-RUNTIME-DIR %s
-// PRINT-RUNTIME-DIR: lib{{/|\\}}windows
-
-// Per target dir layout
-// RUN: %clang -print-runtime-dir --target=x86_64-pc-windows-msvc \
-// RUN:        -resource-dir=%S/Inputs/resource_dir_with_per_target_subdir \
-// RUN:      | FileCheck --check-prefix=PRINT-RUNTIME-DIR-PER-TARGET %s
-// PRINT-RUNTIME-DIR-PER-TARGET: lib{{/|\\}}x86_64-pc-windows-msvc

diff  --git a/clang/test/Driver/print-resource-dir.c b/clang/test/Driver/print-resource-dir.c
new file mode 100644
index 000000000000..d5459a5c5142
--- /dev/null
+++ b/clang/test/Driver/print-resource-dir.c
@@ -0,0 +1,4 @@
+// RUN: %clang -print-resource-dir --target=x86_64-unknown-linux-gnu \
+// RUN:   -resource-dir=%S/Inputs/resource_dir \
+// RUN:   | FileCheck -check-prefix=PRINT-RESOURCE-DIR -DFILE=%S/Inputs/resource_dir %s
+// PRINT-RESOURCE-DIR: [[FILE]]

diff  --git a/clang/test/Driver/print-runtime-dir.c b/clang/test/Driver/print-runtime-dir.c
new file mode 100644
index 000000000000..550ffef1aaf6
--- /dev/null
+++ b/clang/test/Driver/print-runtime-dir.c
@@ -0,0 +1,11 @@
+// Default directory layout
+// RUN: %clang -print-runtime-dir --target=x86_64-pc-windows-msvc \
+// RUN:   -resource-dir=%S/Inputs/resource_dir \
+// RUN:   | FileCheck --check-prefix=PRINT-RUNTIME-DIR -DFILE=%S/Inputs/resource_dir %s
+// PRINT-RUNTIME-DIR: [[FILE]]{{/|\\}}lib{{/|\\}}windows
+
+// Per-target directory layout
+// RUN: %clang -print-runtime-dir --target=x86_64-pc-windows-msvc \
+// RUN:   -resource-dir=%S/Inputs/resource_dir_with_per_target_subdir \
+// RUN:   | FileCheck --check-prefix=PRINT-RUNTIME-DIR-PER-TARGET -DFILE=%S/Inputs/resource_dir_with_per_target_subdir  %s
+// PRINT-RUNTIME-DIR-PER-TARGET: [[FILE]]{{/|\\}}lib{{/|\\}}x86_64-pc-windows-msvc


        


More information about the cfe-commits mailing list