1 ; RUN: llvm-as <%s -bitcode-mdindex-threshold=0 | llvm-bcanalyzer -dump | FileCheck %s -check-prefix=CHECK -check-prefix=MDINDEX
2 ; RUN: llvm-as <%s | llvm-bcanalyzer -dump | FileCheck %s -check-prefix=CHECK
3 ; Check that distinct nodes are emitted in post-order to avoid unnecessary
6 ; Nodes in this testcase are numbered to match how they are referenced in
7 ; bitcode. !3 is referenced as opN=3.
9 ; The leafs should come first (in either order).
10 ; CHECK: <DISTINCT_NODE/>
11 ; CHECK-NEXT: <DISTINCT_NODE/>
15 ; CHECK-NEXT: <DISTINCT_NODE op0=1 op1=2/>
16 !3 = distinct !{!1, !2}
18 ; CHECK-NEXT: <DISTINCT_NODE op0=1 op1=3 op2=2/>
19 !4 = distinct !{!1, !3, !2}
21 ; Before the named records we emit the index containing the position of the
22 ; previously emitted records, but only if we have a number of record above
23 ; a threshold (can be controlled through `-bitcode-mdindex-threshold`).
24 ; MDINDEX: <INDEX {{.*}} (offset match)
26 ; Note: named metadata nodes are not cannot reference null so their operands
27 ; are numbered off-by-one.
29 ; CHECK-NEXT: <NAMED_NODE op0=3/>