/// Test determinisim when serializing anonymous decls. Create enough Decls in /// DeclContext that can overflow the small storage of SmallPtrSet to make sure /// the serialization does not rely on iteration order of SmallPtrSet. // RUN: rm -rf %t.dir // RUN: split-file %s %t.dir // RUN: %clang_cc1 -fmodules -fimplicit-module-maps \ // RUN: -fmodules-cache-path=%t.dir/cache -triple x86_64-apple-macosx10.11.0 \ // RUN: -I%t.dir/headers %t.dir/main.m -fdisable-module-hash -Wno-visibility // RUN: mv %t.dir/cache/A.pcm %t1.pcm /// Check the order of the decls first. If LLVM_ENABLE_REVERSE_ITERATION is on, /// it will fail the test early if the output is depending on the order of items /// in containers that has non-deterministic orders. // RUN: llvm-bcanalyzer --dump --disable-histogram %t1.pcm | FileCheck %s // RUN: rm -rf %t.dir/cache // RUN: %clang_cc1 -fmodules -fimplicit-module-maps \ // RUN: -fmodules-cache-path=%t.dir/cache -triple x86_64-apple-macosx10.11.0 \ // RUN: -I%t.dir/headers %t.dir/main.m -fdisable-module-hash -Wno-visibility // RUN: mv %t.dir/cache/A.pcm %t2.pcm // RUN: diff %t1.pcm %t2.pcm /// Spot check entries to make sure they are in current ordering. /// op6 encodes the anonymous decl number which should be in order. /// NOTE: This test case is on determinism of TypeID for function declaration. /// Change related to TypeID (or PredefinedTypeIDs) will affect the result and /// will require update for this test case. Currently, TypeID is at op6 and the /// test checks the IDs are in strict ordering. // CHECK: