1; RUN: not llvm-as < %s -o /dev/null 2>&1 | FileCheck %s
2
3define i32 @f1(i32 %x) {
4       %y = add i32 %z, 1
5       %z = add i32 %x, 1
6       ret i32 %y
7; CHECK: Instruction does not dominate all uses!
8; CHECK-NEXT:  %z = add i32 %x, 1
9; CHECK-NEXT:  %y = add i32 %z, 1
10}
11
12declare i32 @g()
13define void @f2(i32 %x) {
14bb0:
15  %y1 = invoke i32 @g() to label %bb1 unwind label %bb2
16bb1:
17  ret void
18bb2:
19  %y2 = phi i32 [%y1, %bb0]
20  %y3 = landingpad i32 personality i32 ()* @g
21          cleanup
22  ret void
23; CHECK: Instruction does not dominate all uses!
24; CHECK-NEXT:  %y1 = invoke i32 @g()
25; CHECK-NEXT:        to label %bb1 unwind label %bb2
26; CHECK-NEXT:  %y2 = phi i32 [ %y1, %bb0 ]
27}
28
29define void @f3(i32 %x) {
30bb0:
31  %y1 = invoke i32 @g() to label %bb1 unwind label %bb2
32bb1:
33  ret void
34bb2:
35  %y2 = landingpad i32 personality i32 ()* @g
36          cleanup
37  br label %bb3
38bb3:
39  %y3 = phi i32 [%y1, %bb2]
40  ret void
41; CHECK: Instruction does not dominate all uses!
42; CHECK-NEXT:  %y1 = invoke i32 @g()
43; CHECK-NEXT:          to label %bb1 unwind label %bb2
44; CHECK-NEXT:  %y3 = phi i32 [ %y1, %bb2 ]
45}
46
47define void @f4(i32 %x) {
48bb0:
49  br label %bb1
50bb1:
51  %y3 = phi i32 [%y1, %bb0]
52  %y1 = add i32 %x, 1
53  ret void
54; CHECK: Instruction does not dominate all uses!
55; CHECK-NEXT:  %y1 = add i32 %x, 1
56; CHECK-NEXT:  %y3 = phi i32 [ %y1, %bb0 ]
57}
58