[clang] [ClangModule] Fix decl-params-determinisim test after serialization change (PR #72572)

Steven Wu via cfe-commits cfe-commits at lists.llvm.org
Thu Nov 16 14:01:51 PST 2023


https://github.com/cachemeifyoucan updated https://github.com/llvm/llvm-project/pull/72572

>From 89938936f2e021360e3889548608e76022c3d73b Mon Sep 17 00:00:00 2001
From: Steven Wu <stevenwu at apple.com>
Date: Thu, 16 Nov 2023 13:21:27 -0800
Subject: [PATCH 1/2] [ClangModule] Fix decl-params-determinisim test after
 serialization change

Fix decl-params-determinisim test after 48be81e1 packed some information
in the clang module. The test is to make sure the decls are appearing in
a strict ordering and it relies on check the correct field in the
bitcode format.

Add more explanation in the comments to help future updates when
serialization format affects this test.
---
 clang/test/Modules/decl-params-determinisim.m | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/clang/test/Modules/decl-params-determinisim.m b/clang/test/Modules/decl-params-determinisim.m
index ccad40b98d8edf4..be8c92e587cade1 100644
--- a/clang/test/Modules/decl-params-determinisim.m
+++ b/clang/test/Modules/decl-params-determinisim.m
@@ -23,27 +23,28 @@
 
 /// NOTE: This test case is on determinism of TypeID for function declaration.
 /// Change related to TypeID (or PredefinedTypeIDs) will affect the result and
-/// will require update for this test case.
+/// will require update for this test case. Currently, TypeID is at op6 and the
+/// test checks the IDs are in strict ordering.
 
 // CHECK: <TYPE_FUNCTION_PROTO
 // CHECK-NEXT: <DECL_PARM_VAR
-// CHECK-SAME: op11=4040
+// CHECK-SAME: op6=2
 // CHECK-NEXT: <DECL_PARM_VAR
-// CHECK-SAME: op11=4048
+// CHECK-SAME: op6=3
 // CHECK-NEXT: <DECL_PARM_VAR
-// CHECK-SAME: op11=4056
+// CHECK-SAME: op6=4
 // CHECK-NEXT: <DECL_PARM_VAR
-// CHECK-SAME: op11=4064
+// CHECK-SAME: op6=5
 
 /// Decl records start at 43
 // CHECK: <DECL_RECORD
-// CHECK-SAME: op9=4368
+// CHECK-SAME: op6=43
 // CHECK-NEXT: <DECL_RECORD
-// CHECK-SAME: op9=4376
+// CHECK-SAME: op6=44
 // CHECK-NEXT: <DECL_RECORD
-// CHECK-SAME: op9=4384
+// CHECK-SAME: op6=45
 // CHECK-NEXT: <DECL_RECORD
-// CHECK-SAME: op9=4392
+// CHECK-SAME: op6=46
 
 //--- headers/a.h
 void f(struct A0 *a0,

>From c13f8684239281896d3d3572ea90b9b1e941d755 Mon Sep 17 00:00:00 2001
From: Steven Wu <stevenwu at apple.com>
Date: Thu, 16 Nov 2023 14:01:30 -0800
Subject: [PATCH 2/2] fixup! [ClangModule] Fix decl-params-determinisim test
 after serialization change

---
 clang/test/Modules/decl-params-determinisim.m | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/clang/test/Modules/decl-params-determinisim.m b/clang/test/Modules/decl-params-determinisim.m
index be8c92e587cade1..351403d9af947e2 100644
--- a/clang/test/Modules/decl-params-determinisim.m
+++ b/clang/test/Modules/decl-params-determinisim.m
@@ -19,7 +19,7 @@
 // RUN: diff %t1.pcm %t2.pcm
 
 /// Spot check entries to make sure they are in current ordering.
-/// op13 encodes the anonymous decl number which should be in order.
+/// op6 encodes the anonymous decl number which should be in order.
 
 /// NOTE: This test case is on determinism of TypeID for function declaration.
 /// Change related to TypeID (or PredefinedTypeIDs) will affect the result and



More information about the cfe-commits mailing list