Home | History | Annotate | Download | only in ScalarEvolution
      1 ; RUN: opt < %s -analyze -scalar-evolution | FileCheck %s
      2 
      3 ; CHECK: Printing analysis 'Scalar Evolution Analysis' for function 'test1'
      4 ; CHECK-NOT: (trunc i{{.*}}ext
      5 
      6 define i16 @test1(i8 %x) {
      7   %A = sext i8 %x to i32
      8   %B = trunc i32 %A to i16
      9   ret i16 %B
     10 }
     11 
     12 ; CHECK: Printing analysis 'Scalar Evolution Analysis' for function 'test2'
     13 ; CHECK-NOT: (trunc i{{.*}}ext
     14 
     15 define i8 @test2(i16 %x) {
     16   %A = sext i16 %x to i32
     17   %B = trunc i32 %A to i8
     18   ret i8 %B
     19 }
     20 
     21 ; CHECK: Printing analysis 'Scalar Evolution Analysis' for function 'test3'
     22 ; CHECK-NOT: (trunc i{{.*}}ext
     23 
     24 define i16 @test3(i16 %x) {
     25   %A = sext i16 %x to i32
     26   %B = trunc i32 %A to i16
     27   ret i16 %B
     28 }
     29 
     30 ; CHECK: Printing analysis 'Scalar Evolution Analysis' for function 'test4'
     31 ; CHECK-NOT: (trunc i{{.*}}ext
     32 
     33 define i16 @test4(i8 %x) {
     34   %A = zext i8 %x to i32
     35   %B = trunc i32 %A to i16
     36   ret i16 %B
     37 }
     38 
     39 ; CHECK: Printing analysis 'Scalar Evolution Analysis' for function 'test5'
     40 ; CHECK-NOT: (trunc i{{.*}}ext
     41 
     42 define i8 @test5(i16 %x) {
     43   %A = zext i16 %x to i32
     44   %B = trunc i32 %A to i8
     45   ret i8 %B
     46 }
     47 
     48 ; CHECK: Printing analysis 'Scalar Evolution Analysis' for function 'test6'
     49 ; CHECK-NOT: (trunc i{{.*}}ext
     50 
     51 define i16 @test6(i16 %x) {
     52   %A = zext i16 %x to i32
     53   %B = trunc i32 %A to i16
     54   ret i16 %B
     55 }
     56