Debian Codegraph @

clang/test/Modules/embed-files-compressed.cpp

raw
1 // REQUIRES: zlib || zstd
2 //
3 // RUN: rm -rf %t
4 // RUN: mkdir %t
5 // RUN: echo '//////////////////////////////////////////////////////////////////////' > %t/a.h
6 // RUN: cat %t/a.h %t/a.h %t/a.h %t/a.h > %t/b.h
7 // RUN: cat %t/b.h %t/b.h %t/b.h %t/b.h > %t/a.h
8 // RUN: cat %t/a.h %t/a.h %t/a.h %t/a.h > %t/b.h
9 // RUN: cat %t/b.h %t/b.h %t/b.h %t/b.h > %t/a.h
10 // RUN: cat %t/a.h %t/a.h %t/a.h %t/a.h > %t/b.h
11 // RUN: cat %t/b.h %t/b.h %t/b.h %t/b.h > %t/a.h
12 // RUN: cat %t/a.h %t/a.h %t/a.h %t/a.h > %t/b.h
13 // RUN: cat %t/b.h %t/b.h %t/b.h %t/b.h > %t/a.h
14 // RUN: echo 'module a { header "a.h" }' > %t/modulemap
15 //
16 // 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
17 //
18 // The above embeds ~4.5MB of highly-predictable /s and \ns into the pcm file.
19 // Check that the resulting file is under 80KB:
20 //
21 // RUN: wc -c %t/a.pcm | FileCheck --check-prefix=CHECK-SIZE %s
22 // CHECK-SIZE: {{(^|[^0-9])[1-7][0-9][0-9][0-9][0-9]($|[^0-9])}}