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 /// op6 encodes the anonymous decl number which should be in order.
24 /// NOTE: This test case is on determinism of TypeID for function declaration.
25 /// Change related to TypeID (or PredefinedTypeIDs) will affect the result and
26 /// will require update for this test case. Currently, TypeID is at op6 and the
27 /// test checks the IDs are in strict ordering.
29 // CHECK: <TYPE_FUNCTION_PROTO
30 // CHECK-NEXT: <DECL_PARM_VAR
32 // CHECK-NEXT: <DECL_PARM_VAR
34 // CHECK-NEXT: <DECL_PARM_VAR
36 // CHECK-NEXT: <DECL_PARM_VAR
39 /// Decl records start at 43
40 // CHECK: <DECL_RECORD
42 // CHECK-NEXT: <DECL_RECORD
44 // CHECK-NEXT: <DECL_RECORD
46 // CHECK-NEXT: <DECL_RECORD
93 //--- headers/module.modulemap