[PATCH] D79998: Add AST_SIGNATURE record to unhashed control block of pcm files (Patch series 2/3)

Daniel Grumberg via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed May 20 08:43:21 PDT 2020


dang updated this revision to Diff 265262.
dang added a comment.
Herald added a subscriber: ormris.

Add a small bug fix and test case


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D79998/new/

https://reviews.llvm.org/D79998

Files:
  clang/test/Modules/ASTSignature.c
  clang/test/Modules/Inputs/ASTHash/module.modulemap
  clang/test/Modules/Inputs/ASTHash/my_header_1.h
  clang/test/Modules/Inputs/ASTHash/my_header_2.h


Index: clang/test/Modules/Inputs/ASTHash/my_header_2.h
===================================================================
--- /dev/null
+++ clang/test/Modules/Inputs/ASTHash/my_header_2.h
@@ -0,0 +1,3 @@
+#include "my_header_1.h"
+
+extern my_int var;
Index: clang/test/Modules/Inputs/ASTHash/my_header_1.h
===================================================================
--- /dev/null
+++ clang/test/Modules/Inputs/ASTHash/my_header_1.h
@@ -0,0 +1 @@
+typedef int my_int;
Index: clang/test/Modules/Inputs/ASTHash/module.modulemap
===================================================================
--- /dev/null
+++ clang/test/Modules/Inputs/ASTHash/module.modulemap
@@ -0,0 +1,8 @@
+module MyHeader1 {
+  header "my_header_1.h"
+}
+
+module MyHeader2 {
+  header "my_header_2.h"
+  export *
+}
Index: clang/test/Modules/ASTSignature.c
===================================================================
--- /dev/null
+++ clang/test/Modules/ASTSignature.c
@@ -0,0 +1,18 @@
+// RUN: rm -rf %t
+// RUN: %clang_cc1 -iquote %S/Inputs/ASTHash/ -fsyntax-only -fmodules \
+// RUN:   -fimplicit-module-maps -fmodules-strict-context-hash \
+// RUN:   -fmodules-cache-path=%t %s -Rmodule-build 2> %t1
+// RUN: %clang_cc1 -iquote "/dev/null" -iquote %S/Inputs/ASTHash/ -fsyntax-only \
+// RUN:   -fmodules -fimplicit-module-maps -fmodules-strict-context-hash \
+// RUN:   -fmodules-cache-path=%t %s -Rmodule-build 2> %t2
+// RUN: cat %t1 | grep "remark: building module 'MyHeader2'" | cut -d "'" -f 4 \
+// RUN:  | while read -r MODULE; do llvm-bcanalyzer --dump --disable-histogram \
+// RUN:  $MODULE | grep "AST_SIGNATURE" > %t1.sig; done
+// RUN: cat %t2 | grep "remark: building module 'MyHeader2'" | cut -d "'" -f 4 \
+// RUN:  | while read -r MODULE; do llvm-bcanalyzer --dump --disable-histogram \
+// RUN:  $MODULE | grep "AST_SIGNATURE" > %t1.sig; done
+// RUN: diff %t1.sig %t2.sig
+
+#include "my_header_2.h"
+
+my_int var = 42;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D79998.265262.patch
Type: text/x-patch
Size: 1935 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20200520/bbdf8a5c/attachment-0001.bin>


More information about the cfe-commits mailing list