xref: /aosp_15_r20/external/llvm/test/Bitcode/mdnodes-distinct-nodes-first.ll (revision 9880d6810fe72a1726cb53787c6711e909410d58)
1*9880d681SAndroid Build Coastguard Worker; RUN: llvm-as <%s | llvm-bcanalyzer -dump | FileCheck %s
2*9880d681SAndroid Build Coastguard Worker; Check that distinct nodes are emitted before uniqued nodes, even if that
3*9880d681SAndroid Build Coastguard Worker; breaks post-order traversals.
4*9880d681SAndroid Build Coastguard Worker
5*9880d681SAndroid Build Coastguard Worker; Nodes in this testcase are numbered to match how they are referenced in
6*9880d681SAndroid Build Coastguard Worker; bitcode.  !1 is referenced as opN=1.
7*9880d681SAndroid Build Coastguard Worker
8*9880d681SAndroid Build Coastguard Worker; CHECK:       <DISTINCT_NODE op0=2/>
9*9880d681SAndroid Build Coastguard Worker!1 = distinct !{!2}
10*9880d681SAndroid Build Coastguard Worker
11*9880d681SAndroid Build Coastguard Worker; CHECK-NEXT:  <NODE op0=1/>
12*9880d681SAndroid Build Coastguard Worker!2 = !{!1}
13*9880d681SAndroid Build Coastguard Worker
14*9880d681SAndroid Build Coastguard Worker; Note: named metadata nodes are not cannot reference null so their operands
15*9880d681SAndroid Build Coastguard Worker; are numbered off-by-one.
16*9880d681SAndroid Build Coastguard Worker; CHECK-NEXT:  <NAME
17*9880d681SAndroid Build Coastguard Worker; CHECK-NEXT:  <NAMED_NODE op0=1/>
18*9880d681SAndroid Build Coastguard Worker!named = !{!2}
19