[PATCH] D124634: ExtractAPI: Use %clang_cc1 and -verify in enum.c

Duncan P. N. Exon Smith via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Apr 28 12:47:23 PDT 2022


dexonsmith created this revision.
dexonsmith added reviewers: zixuw, dang, ributzka.
Herald added a project: All.
dexonsmith requested review of this revision.
Herald added a project: clang.

Fix one test (enum.c) in ExtractAPI to use %clang_cc1 and -verify
instead of calling the full driver and FileCheck. This is an example for
my comment from https://reviews.llvm.org/D121873.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D124634

Files:
  clang/test/ExtractAPI/enum.c


Index: clang/test/ExtractAPI/enum.c
===================================================================
--- clang/test/ExtractAPI/enum.c
+++ clang/test/ExtractAPI/enum.c
@@ -2,17 +2,14 @@
 // RUN: split-file %s %t
 // 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
+// RUN: %clang_cc1 -extract-api -triple arm64-apple-macosx \
+// RUN:   -x c-header %t/input.h -o %t/output.json -verify
 
 // Generator version is not consistent across test runs, normalize it.
 // RUN: sed -e "s@\"generator\": \".*\"@\"generator\": \"?\"@g" \
 // RUN: %t/output.json >> %t/output-normalized.json
 // RUN: diff %t/reference.output.json %t/output-normalized.json
 
-// CHECK-NOT: error:
-// CHECK-NOT: warning:
-
 //--- input.h
 /// Kinds of vehicles
 enum Vehicle {
@@ -37,6 +34,7 @@
 enum {
   OtherConstant = 2
 };
+// expected-no-diagnostics
 
 //--- reference.output.json.in
 {


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D124634.425882.patch
Type: text/x-patch
Size: 1062 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20220428/c6a836cf/attachment.bin>


More information about the cfe-commits mailing list