1 /// Test determinisim when serializing anonymous decls. Create enough Decls in
2 /// DeclContext that can overflow the small storage of SmallPtrSet to make sure
3 /// the serialization does not rely on iteration order of SmallPtrSet.
5 // RUN: split-file %s %t.dir
6 // RUN: %clang_cc1 -fmodules -fimplicit-module-maps \
7 // RUN: -fmodules-cache-path=%t.dir/cache -triple x86_64-apple-macosx10.11.0 \
8 // RUN: -I%t.dir/headers %t.dir/main.m -fdisable-module-hash -Wno-visibility
9 // RUN: mv %t.dir/cache/A.pcm %t1.pcm
10 /// Check the order of the decls first. If LLVM_ENABLE_REVERSE_ITERATION is on,
11 /// it will fail the test early if the output is depending on the order of items
12 /// in containers that has non-deterministic orders.
13 // RUN: llvm-bcanalyzer --dump --disable-histogram %t1.pcm | FileCheck %s
14 // RUN: rm -rf %t.dir/cache
15 // RUN: %clang_cc1 -fmodules -fimplicit-module-maps \
16 // RUN: -fmodules-cache-path=%t.dir/cache -triple x86_64-apple-macosx10.11.0 \
17 // RUN: -I%t.dir/headers %t.dir/main.m -fdisable-module-hash -Wno-visibility
18 // RUN: mv %t.dir/cache/A.pcm %t2.pcm
19 // RUN: diff %t1.pcm %t2.pcm
21 /// Spot check entries to make sure they are in current ordering.
22 /// op13 encodes the anonymous decl number which should be in order.
23 // CHECK: <TYPE_FUNCTION_PROTO
24 // CHECK-NEXT: <DECL_PARM_VAR
26 // CHECK-NEXT: <DECL_PARM_VAR
28 // CHECK-NEXT: <DECL_PARM_VAR
30 // CHECK-NEXT: <DECL_PARM_VAR
33 /// Decl records start at 43
34 // CHECK: <DECL_RECORD
35 // CHECK-SAME: op13=43
36 // CHECK-NEXT: <DECL_RECORD
37 // CHECK-SAME: op13=44
38 // CHECK-NEXT: <DECL_RECORD
39 // CHECK-SAME: op13=45
40 // CHECK-NEXT: <DECL_RECORD
41 // CHECK-SAME: op13=46
87 //--- headers/module.modulemap