Home | History | Annotate | Download | only in MergeFunc
      1 ; RUN: opt -S -mergefunc < %s | FileCheck %s
      2 
      3 ; RUN: opt -S -mergefunc < %s | FileCheck -check-prefix=NOPLUS %s
      4 
      5 ; This makes sure that zeros in constants don't cause problems with string based
      6 ; memory comparisons
      7 define internal i32 @sum(i32 %x, i32 %y) {
      8 ; CHECK-LABEL: @sum
      9   %sum = add i32 %x, %y
     10   %1 = extractvalue [3 x i32] [ i32 3, i32 0, i32 2 ], 2
     11   %sum2 = add i32 %sum, %1
     12   %sum3 = add i32 %sum2, %y
     13   ret i32 %sum3
     14 }
     15 
     16 define internal i32 @add(i32 %x, i32 %y) {
     17 ; CHECK-LABEL: @add
     18   %sum = add i32 %x, %y
     19   %1 = extractvalue [3 x i32] [ i32 3, i32 0, i32 1 ], 2
     20   %sum2 = add i32 %sum, %1
     21   %sum3 = add i32 %sum2, %y
     22   ret i32 %sum3
     23 }
     24 
     25 define internal i32 @plus(i32 %x, i32 %y) {
     26 ; NOPLUS-NOT: @plus
     27   %sum = add i32 %x, %y
     28   %1 = extractvalue [3 x i32] [ i32 3, i32 0, i32 5 ], 2
     29   %sum2 = add i32 %sum, %1
     30   %sum3 = add i32 %sum2, %y
     31   ret i32 %sum3
     32 }
     33 
     34 define internal i32 @next(i32 %x, i32 %y) {
     35 ; CHECK-LABEL: @next
     36   %sum = add i32 %x, %y
     37   %1 = extractvalue [3 x i32] [ i32 3, i32 0, i32 5 ], 2
     38   %sum2 = add i32 %sum, %1
     39   %sum3 = add i32 %sum2, %y
     40   ret i32 %sum3
     41 }
     42 
     43