[clang] e08c435 - [clang][ExtractAPI][NFC] Fix sed delimiter in test

Zixu Wang via cfe-commits cfe-commits at lists.llvm.org
Tue Apr 12 10:04:28 PDT 2022


Author: Zixu Wang
Date: 2022-04-12T10:00:15-07:00
New Revision: e08c435401bc335c687b693591feafd7dbca1455

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

LOG: [clang][ExtractAPI][NFC] Fix sed delimiter in test

Fix path replacement in sed (properly this time) using lit
regex_replacement.

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

Co-authored-by: Michele Scandale <michele.scandale at gmail.com>
Co-authored-by: Zixu Wang <9819235+zixu-w at users.noreply.github.com>

Added: 
    

Modified: 
    clang/test/ExtractAPI/enum.c
    clang/test/ExtractAPI/global_record.c
    clang/test/ExtractAPI/global_record_multifile.c
    clang/test/ExtractAPI/known_files_only.c
    clang/test/ExtractAPI/known_files_only_hmap.c
    clang/test/ExtractAPI/language.c
    clang/test/ExtractAPI/macro_undefined.c
    clang/test/ExtractAPI/macros.c
    clang/test/ExtractAPI/objc_category.m
    clang/test/ExtractAPI/objc_interface.m
    clang/test/ExtractAPI/objc_protocol.m
    clang/test/ExtractAPI/struct.c
    clang/test/ExtractAPI/typedef.c
    clang/test/ExtractAPI/typedef_anonymous_record.c
    clang/test/ExtractAPI/typedef_chain.c

Removed: 
    


################################################################################
diff  --git a/clang/test/ExtractAPI/enum.c b/clang/test/ExtractAPI/enum.c
index 60f69059c942f..49e39f7ba410a 100644
--- a/clang/test/ExtractAPI/enum.c
+++ b/clang/test/ExtractAPI/enum.c
@@ -1,7 +1,7 @@
 // RUN: rm -rf %t
 // RUN: split-file %s %t
-// RUN: sed -e "s at INPUT_DIR@%/t at g" %t/reference.output.json.in >> \
-// RUN: %t/reference.output.json
+// RUN: sed -e "s at INPUT_DIR@%{/t:regex_replacement}@g" \
+// RUN: %t/reference.output.json.in >> %t/reference.output.json
 // RUN: %clang -extract-api -target arm64-apple-macosx \
 // RUN: %t/input.h -o %t/output.json | FileCheck -allow-empty %s
 

diff  --git a/clang/test/ExtractAPI/global_record.c b/clang/test/ExtractAPI/global_record.c
index 1722c03eb47f9..8516ac50be858 100644
--- a/clang/test/ExtractAPI/global_record.c
+++ b/clang/test/ExtractAPI/global_record.c
@@ -1,7 +1,7 @@
 // RUN: rm -rf %t
 // RUN: split-file %s %t
-// RUN: sed -e "s at INPUT_DIR@%/t at g" %t/reference.output.json.in >> \
-// RUN: %t/reference.output.json
+// RUN: sed -e "s at INPUT_DIR@%{/t:regex_replacement}@g" \
+// RUN: %t/reference.output.json.in >> %t/reference.output.json
 // RUN: %clang -extract-api --product-name=GlobalRecord -target arm64-apple-macosx \
 // RUN: %t/input.h -o %t/output.json | FileCheck -allow-empty %s
 

diff  --git a/clang/test/ExtractAPI/global_record_multifile.c b/clang/test/ExtractAPI/global_record_multifile.c
index 4d6566506a226..0eacb8a94b77f 100644
--- a/clang/test/ExtractAPI/global_record_multifile.c
+++ b/clang/test/ExtractAPI/global_record_multifile.c
@@ -1,7 +1,7 @@
 // RUN: rm -rf %t
 // RUN: split-file %s %t
-// RUN: sed -e "s at INPUT_DIR@%/t at g" %t/reference.output.json.in >> \
-// RUN: %t/reference.output.json
+// RUN: sed -e "s at INPUT_DIR@%{/t:regex_replacement}@g" \
+// RUN: %t/reference.output.json.in >> %t/reference.output.json
 // RUN: %clang -extract-api --product-name=GlobalRecord -target arm64-apple-macosx \
 // RUN: %t/input1.h %t/input2.h %t/input3.h -o %t/output.json | FileCheck -allow-empty %s
 

diff  --git a/clang/test/ExtractAPI/known_files_only.c b/clang/test/ExtractAPI/known_files_only.c
index 6baba4e7d921e..ddb6e577823a8 100644
--- a/clang/test/ExtractAPI/known_files_only.c
+++ b/clang/test/ExtractAPI/known_files_only.c
@@ -1,7 +1,7 @@
 // RUN: rm -rf %t
 // RUN: split-file %s %t
-// RUN: sed -e "s at INPUT_DIR@%/t at g" %t/reference.output.json.in >> \
-// RUN: %t/reference.output.json
+// RUN: sed -e "s at INPUT_DIR@%{/t:regex_replacement}@g" \
+// RUN: %t/reference.output.json.in >> %t/reference.output.json
 // RUN: %clang -extract-api --product-name=GlobalRecord -target arm64-apple-macosx \
 // RUN: %t/input1.h -o %t/output.json | FileCheck -allow-empty %s
 

diff  --git a/clang/test/ExtractAPI/known_files_only_hmap.c b/clang/test/ExtractAPI/known_files_only_hmap.c
index d5d06e65aa6f9..3b7609a73b267 100644
--- a/clang/test/ExtractAPI/known_files_only_hmap.c
+++ b/clang/test/ExtractAPI/known_files_only_hmap.c
@@ -1,9 +1,9 @@
 // RUN: rm -rf %t
 // RUN: split-file %s %t
-// RUN: sed -e "s at INPUT_DIR@%/t at g" %t/reference.output.json.in >> \
-// RUN: %t/reference.output.json
-// RUN: sed -e "s at INPUT_DIR@%/t at g" %t/known_files_only.hmap.json.in >> \
-// RUN: %t/known_files_only.hmap.json
+// RUN: sed -e "s at INPUT_DIR@%{/t:regex_replacement}@g" \
+// RUN: %t/reference.output.json.in >> %t/reference.output.json
+// RUN: sed -e "s at INPUT_DIR@%{/t:regex_replacement}@g" \
+// RUN: %t/known_files_only.hmap.json.in >> %t/known_files_only.hmap.json
 // RUN: %hmaptool write %t/known_files_only.hmap.json %t/known_files_only.hmap
 // RUN: %clang -extract-api --product-name=KnownFilesOnlyHmap -target arm64-apple-macosx \
 // RUN: -I%t/known_files_only.hmap -I%t/subdir %t/subdir/subdir1/input.h \

diff  --git a/clang/test/ExtractAPI/language.c b/clang/test/ExtractAPI/language.c
index 7effe75807d48..b9f69b272a44c 100644
--- a/clang/test/ExtractAPI/language.c
+++ b/clang/test/ExtractAPI/language.c
@@ -1,9 +1,9 @@
 // RUN: rm -rf %t
 // RUN: split-file %s %t
-// RUN: sed -e "s at INPUT_DIR@%/t at g" %t/c.reference.output.json.in >> \
-// RUN: %t/c.reference.output.json
-// RUN: sed -e "s at INPUT_DIR@%/t at g" %t/objc.reference.output.json.in >> \
-// RUN: %t/objc.reference.output.json
+// RUN: sed -e "s at INPUT_DIR@%{/t:regex_replacement}@g" \
+// RUN: %t/c.reference.output.json.in >> %t/c.reference.output.json
+// RUN: sed -e "s at INPUT_DIR@%{/t:regex_replacement}@g" \
+// RUN: %t/objc.reference.output.json.in >> %t/objc.reference.output.json
 
 // RUN: %clang -extract-api -x c-header -target arm64-apple-macosx \
 // RUN: %t/c.h -o %t/c.output.json | FileCheck -allow-empty %s

diff  --git a/clang/test/ExtractAPI/macro_undefined.c b/clang/test/ExtractAPI/macro_undefined.c
index 9eee8ebb22f0f..c7d3dd6cfea8c 100644
--- a/clang/test/ExtractAPI/macro_undefined.c
+++ b/clang/test/ExtractAPI/macro_undefined.c
@@ -1,7 +1,7 @@
 // RUN: rm -rf %t
 // RUN: split-file %s %t
-// RUN: sed -e "s at INPUT_DIR@%/t at g" %t/reference.output.json.in >> \
-// RUN: %t/reference.output.json
+// RUN: sed -e "s at INPUT_DIR@%{/t:regex_replacement}@g" \
+// RUN: %t/reference.output.json.in >> %t/reference.output.json
 // RUN: %clang -extract-api --product-name=Macros -target arm64-apple-macosx \
 // RUN: -x objective-c-header %t/input.h -o %t/output.json | FileCheck -allow-empty %s
 

diff  --git a/clang/test/ExtractAPI/macros.c b/clang/test/ExtractAPI/macros.c
index eb8e3f2b8e3aa..c8df9ec8a9daa 100644
--- a/clang/test/ExtractAPI/macros.c
+++ b/clang/test/ExtractAPI/macros.c
@@ -1,7 +1,7 @@
 // RUN: rm -rf %t
 // RUN: split-file %s %t
-// RUN: sed -e "s at INPUT_DIR@%/t at g" %t/reference.output.json.in >> \
-// RUN: %t/reference.output.json
+// RUN: sed -e "s at INPUT_DIR@%{/t:regex_replacement}@g" \
+// RUN: %t/reference.output.json.in >> %t/reference.output.json
 // RUN: %clang -extract-api --product-name=Macros -target arm64-apple-macosx \
 // RUN: -x objective-c-header %t/input.h -o %t/output.json | FileCheck -allow-empty %s
 

diff  --git a/clang/test/ExtractAPI/objc_category.m b/clang/test/ExtractAPI/objc_category.m
index 2a69740203c3a..946f01eaeb334 100644
--- a/clang/test/ExtractAPI/objc_category.m
+++ b/clang/test/ExtractAPI/objc_category.m
@@ -1,7 +1,7 @@
 // RUN: rm -rf %t
 // RUN: split-file %s %t
-// RUN: sed -e "s at INPUT_DIR@%/t at g" %t/reference.output.json.in >> \
-// RUN: %t/reference.output.json
+// RUN: sed -e "s at INPUT_DIR@%{/t:regex_replacement}@g" \
+// RUN: %t/reference.output.json.in >> %t/reference.output.json
 // RUN: %clang -extract-api -x objective-c-header -target arm64-apple-macosx \
 // RUN: %t/input.h -o %t/output.json | FileCheck -allow-empty %s
 

diff  --git a/clang/test/ExtractAPI/objc_interface.m b/clang/test/ExtractAPI/objc_interface.m
index 1ac2f81a80603..bd1f23ed1f095 100644
--- a/clang/test/ExtractAPI/objc_interface.m
+++ b/clang/test/ExtractAPI/objc_interface.m
@@ -1,7 +1,7 @@
 // RUN: rm -rf %t
 // RUN: split-file %s %t
-// RUN: sed -e "s at INPUT_DIR@%/t at g" %t/reference.output.json.in >> \
-// RUN: %t/reference.output.json
+// RUN: sed -e "s at INPUT_DIR@%{/t:regex_replacement}@g" \
+// RUN: %t/reference.output.json.in >> %t/reference.output.json
 // RUN: %clang -extract-api -x objective-c-header -target arm64-apple-macosx \
 // RUN: %t/input.h -o %t/output.json | FileCheck -allow-empty %s
 

diff  --git a/clang/test/ExtractAPI/objc_protocol.m b/clang/test/ExtractAPI/objc_protocol.m
index 28cc0c3a73df4..036850924587c 100644
--- a/clang/test/ExtractAPI/objc_protocol.m
+++ b/clang/test/ExtractAPI/objc_protocol.m
@@ -1,7 +1,7 @@
 // RUN: rm -rf %t
 // RUN: split-file %s %t
-// RUN: sed -e "s at INPUT_DIR@%/t at g" %t/reference.output.json.in >> \
-// RUN: %t/reference.output.json
+// RUN: sed -e "s at INPUT_DIR@%{/t:regex_replacement}@g" \
+// RUN: %t/reference.output.json.in >> %t/reference.output.json
 // RUN: %clang -extract-api -x objective-c-header -target arm64-apple-macosx \
 // RUN: %t/input.h -o %t/output.json | FileCheck -allow-empty %s
 

diff  --git a/clang/test/ExtractAPI/struct.c b/clang/test/ExtractAPI/struct.c
index 38f55c19119e3..516055768749c 100644
--- a/clang/test/ExtractAPI/struct.c
+++ b/clang/test/ExtractAPI/struct.c
@@ -1,7 +1,7 @@
 // RUN: rm -rf %t
 // RUN: split-file %s %t
-// RUN: sed -e "s at INPUT_DIR@%/t at g" %t/reference.output.json.in >> \
-// RUN: %t/reference.output.json
+// RUN: sed -e "s at INPUT_DIR@%{/t:regex_replacement}@g" \
+// RUN: %t/reference.output.json.in >> %t/reference.output.json
 // RUN: %clang -extract-api -target arm64-apple-macosx \
 // RUN: %t/input.h -o %t/output.json | FileCheck -allow-empty %s
 

diff  --git a/clang/test/ExtractAPI/typedef.c b/clang/test/ExtractAPI/typedef.c
index 4d1fd01566fdd..fb9b8ef32cdc1 100644
--- a/clang/test/ExtractAPI/typedef.c
+++ b/clang/test/ExtractAPI/typedef.c
@@ -1,7 +1,7 @@
 // RUN: rm -rf %t
 // RUN: split-file %s %t
-// RUN: sed -e "s at INPUT_DIR@%/t at g" %t/reference.output.json.in >> \
-// RUN: %t/reference.output.json
+// RUN: sed -e "s at INPUT_DIR@%{/t:regex_replacement}@g" \
+// RUN: %t/reference.output.json.in >> %t/reference.output.json
 // RUN: %clang -extract-api --product-name=Typedef -target arm64-apple-macosx \
 // RUN: -x objective-c-header %t/input.h -o %t/output.json | FileCheck -allow-empty %s
 

diff  --git a/clang/test/ExtractAPI/typedef_anonymous_record.c b/clang/test/ExtractAPI/typedef_anonymous_record.c
index 5444239fe3464..e3e34769321f1 100644
--- a/clang/test/ExtractAPI/typedef_anonymous_record.c
+++ b/clang/test/ExtractAPI/typedef_anonymous_record.c
@@ -1,7 +1,7 @@
 // RUN: rm -rf %t
 // RUN: split-file %s %t
-// RUN: sed -e "s at INPUT_DIR@%/t at g" %t/reference.output.json.in >> \
-// RUN: %t/reference.output.json
+// RUN: sed -e "s at INPUT_DIR@%{/t:regex_replacement}@g" \
+// RUN: %t/reference.output.json.in >> %t/reference.output.json
 // RUN: %clang -extract-api --product-name=TypedefChain -target arm64-apple-macosx \
 // RUN: -x objective-c-header %t/input.h -o %t/output.json | FileCheck -allow-empty %s
 

diff  --git a/clang/test/ExtractAPI/typedef_chain.c b/clang/test/ExtractAPI/typedef_chain.c
index 42a78d1d541cf..3ba47651fda1e 100644
--- a/clang/test/ExtractAPI/typedef_chain.c
+++ b/clang/test/ExtractAPI/typedef_chain.c
@@ -1,7 +1,7 @@
 // RUN: rm -rf %t
 // RUN: split-file %s %t
-// RUN: sed -e "s at INPUT_DIR@%/t at g" %t/reference.output.json.in >> \
-// RUN: %t/reference.output.json
+// RUN: sed -e "s at INPUT_DIR@%{/t:regex_replacement}@g" \
+// RUN: %t/reference.output.json.in >> %t/reference.output.json
 // RUN: %clang -extract-api --product-name=TypedefChain -target arm64-apple-macosx \
 // RUN: -x objective-c-header %t/input.h -o %t/output.json | FileCheck -allow-empty %s
 


        


More information about the cfe-commits mailing list