1; RUN: llvm-as %s -o %t.bc
2; RUN: llvm-link -S %t.bc -o - | FileCheck %s
3; RUN: llvm-link -S %s -o - | FileCheck %s
4
5; Test that we don't try to map %C.0 and C and then try to map %C to a new type.
6; This used to happen when lazy loading since we wouldn't then identify %C
7; as a destination type until it was too late.
8
9; CHECK: %C.0 = type { %B }
10; CHECK-NEXT: %B = type { %A }
11; CHECK-NEXT: %A = type { i8 }
12
13; CHECK: @g1 = external global %C.0
14; CHECK:  getelementptr %C.0* null, i64 0, i32 0, i32 0
15
16%A   = type { i8 }
17%B   = type { %A }
18%C   = type { %B }
19%C.0 = type { %B }
20define void @f1() {
21  getelementptr %C* null, i64 0, i32 0, i32 0
22  ret void
23}
24@g1 = external global %C.0
25