51 lines · plain
1; RUN: opt -S -passes=mergefunc < %s | FileCheck %s2 3; Ensure that we do not merge functions that are identical with the4; exception of the order of the incoming blocks to a phi.5 6; CHECK-LABEL: define linkonce_odr hidden i1 @first(i2 %0)7define linkonce_odr hidden i1 @first(i2 %0) {8entry:9; CHECK: switch i210 switch i2 %0, label %default [11 i2 0, label %L112 i2 1, label %L213 i2 -2, label %L314 ]15default:16 unreachable17L1:18 br label %done19L2:20 br label %done21L3:22 br label %done23done:24 %result = phi i1 [ true, %L1 ], [ false, %L2 ], [ false, %L3 ]25; CHECK: ret i126 ret i1 %result27}28 29; CHECK-LABEL: define linkonce_odr hidden i1 @second(i2 %0)30define linkonce_odr hidden i1 @second(i2 %0) {31entry:32; CHECK: switch i233 switch i2 %0, label %default [34 i2 0, label %L135 i2 1, label %L236 i2 -2, label %L337 ]38default:39 unreachable40L1:41 br label %done42L2:43 br label %done44L3:45 br label %done46done:47 %result = phi i1 [ true, %L3 ], [ false, %L2 ], [ false, %L1 ]48; CHECK: ret i149 ret i1 %result50}51