llvm-capstone/clang/test/Modules/embed-files-compressed.cpp
Roger Ferrer Ibanez fa45f81ff7 [clang][Serialization][RISCV] Increase the number of reserved predefined type IDs
In D152070 we added many new intrinsic types required for the RISC-V
Vector Extension.

This was crashing when loading the AST as those types are intrinsically
added to the AST (they don't come from the disk).

The total number required now by clang exceeds 400 so increasing the
value to 500 solves the problem. This value was already increased in
D92715 but I assume this has some impact on the on-disk format.

Also add a static assert to avoid this happening again in the future.

Differential Revision: https://reviews.llvm.org/D153111
2023-06-19 14:37:46 +00:00

24 lines
1.0 KiB
C++

// REQUIRES: zlib || zstd
// REQUIRES: shell
//
// RUN: rm -rf %t
// RUN: mkdir %t
// RUN: echo '//////////////////////////////////////////////////////////////////////' > %t/a.h
// RUN: cat %t/a.h %t/a.h %t/a.h %t/a.h > %t/b.h
// RUN: cat %t/b.h %t/b.h %t/b.h %t/b.h > %t/a.h
// RUN: cat %t/a.h %t/a.h %t/a.h %t/a.h > %t/b.h
// RUN: cat %t/b.h %t/b.h %t/b.h %t/b.h > %t/a.h
// RUN: cat %t/a.h %t/a.h %t/a.h %t/a.h > %t/b.h
// RUN: cat %t/b.h %t/b.h %t/b.h %t/b.h > %t/a.h
// RUN: cat %t/a.h %t/a.h %t/a.h %t/a.h > %t/b.h
// RUN: cat %t/b.h %t/b.h %t/b.h %t/b.h > %t/a.h
// RUN: echo 'module a { header "a.h" }' > %t/modulemap
//
// RUN: %clang_cc1 -fmodules -I%t -fmodules-cache-path=%t -fmodule-name=a -emit-module %t/modulemap -fmodules-embed-all-files -o %t/a.pcm
//
// The above embeds ~4.5MB of highly-predictable /s and \ns into the pcm file.
// Check that the resulting file is under 60KB:
//
// RUN: wc -c %t/a.pcm | FileCheck --check-prefix=CHECK-SIZE %s
// CHECK-SIZE: {{(^|[^0-9])[1-5][0-9][0-9][0-9][0-9]($|[^0-9])}}