81 lines · plain
1; RUN: not llvm-as < %s -o /dev/null 2>&1 | FileCheck %s2 3define i32 @f1(i32 %x) {4 %y = add i32 %z, 15 %z = add i32 %x, 16 ret i32 %y7; CHECK: Instruction does not dominate all uses!8; CHECK-NEXT: %z = add i32 %x, 19; CHECK-NEXT: %y = add i32 %z, 110}11 12declare i32 @g()13define void @f2(i32 %x) personality ptr @g {14bb0:15 %y1 = invoke i32 @g() to label %bb1 unwind label %bb216bb1:17 ret void18bb2:19 %y2 = phi i32 [%y1, %bb0]20 %y3 = landingpad i3221 cleanup22 ret void23; CHECK: Instruction does not dominate all uses!24; CHECK-NEXT: %y1 = invoke i32 @g()25; CHECK-NEXT: to label %bb1 unwind label %bb226; CHECK-NEXT: %y2 = phi i32 [ %y1, %bb0 ]27}28 29define void @f3(i32 %x) personality ptr @g {30bb0:31 %y1 = invoke i32 @g() to label %bb1 unwind label %bb232bb1:33 ret void34bb2:35 %y2 = landingpad i3236 cleanup37 br label %bb338bb3:39 %y3 = phi i32 [%y1, %bb2]40 ret void41; CHECK: Instruction does not dominate all uses!42; CHECK-NEXT: %y1 = invoke i32 @g()43; CHECK-NEXT: to label %bb1 unwind label %bb244; CHECK-NEXT: %y3 = phi i32 [ %y1, %bb2 ]45}46 47define void @f4(i32 %x) {48bb0:49 br label %bb150bb1:51 %y3 = phi i32 [%y1, %bb0]52 %y1 = add i32 %x, 153 ret void54; CHECK: Instruction does not dominate all uses!55; CHECK-NEXT: %y1 = add i32 %x, 156; CHECK-NEXT: %y3 = phi i32 [ %y1, %bb0 ]57}58 59define void @f5() {60entry:61 br label %next62 63next:64 %y = phi i32 [ 0, %entry ]65 %x = phi i32 [ %y, %entry ]66 ret void67; CHECK: Instruction does not dominate all uses!68; CHECK-NEXT: %y = phi i32 [ 0, %entry ]69; CHECK-NEXT: %x = phi i32 [ %y, %entry ]70}71 72;; No issue!73define i32 @f6(i32 %x) {74bb0:75 %y1 = callbr i32 asm "", "=r,!i"() to label %bb1 [label %bb2]76bb1:77 ret i32 078bb2:79 ret i32 %y180}81