Home | History | Annotate | Download | only in Assembler
      1 ; Test to make sure intrinsics are automatically upgraded.
      2 ; RUN: llvm-as < %s | llvm-dis | FileCheck %s
      3 
      4 declare i8 @llvm.ctlz.i8(i8)
      5 declare i16 @llvm.ctlz.i16(i16)
      6 declare i32 @llvm.ctlz.i32(i32)
      7 declare i42 @llvm.ctlz.i42(i42)  ; Not a power-of-2
      8 
      9 define void @test.ctlz(i8 %a, i16 %b, i32 %c, i42 %d) {
     10 ; CHECK: @test.ctlz
     11 
     12 entry:
     13   ; CHECK: call i8 @llvm.ctlz.i8(i8 %a, i1 false)
     14   call i8 @llvm.ctlz.i8(i8 %a)
     15   ; CHECK: call i16 @llvm.ctlz.i16(i16 %b, i1 false)
     16   call i16 @llvm.ctlz.i16(i16 %b)
     17   ; CHECK: call i32 @llvm.ctlz.i32(i32 %c, i1 false)
     18   call i32 @llvm.ctlz.i32(i32 %c)
     19   ; CHECK: call i42 @llvm.ctlz.i42(i42 %d, i1 false)
     20   call i42 @llvm.ctlz.i42(i42 %d)
     21 
     22   ret void
     23 }
     24 
     25 declare i8 @llvm.cttz.i8(i8)
     26 declare i16 @llvm.cttz.i16(i16)
     27 declare i32 @llvm.cttz.i32(i32)
     28 declare i42 @llvm.cttz.i42(i42)  ; Not a power-of-2
     29 
     30 define void @test.cttz(i8 %a, i16 %b, i32 %c, i42 %d) {
     31 ; CHECK: @test.cttz
     32 
     33 entry:
     34   ; CHECK: call i8 @llvm.cttz.i8(i8 %a, i1 false)
     35   call i8 @llvm.cttz.i8(i8 %a)
     36   ; CHECK: call i16 @llvm.cttz.i16(i16 %b, i1 false)
     37   call i16 @llvm.cttz.i16(i16 %b)
     38   ; CHECK: call i32 @llvm.cttz.i32(i32 %c, i1 false)
     39   call i32 @llvm.cttz.i32(i32 %c)
     40   ; CHECK: call i42 @llvm.cttz.i42(i42 %d, i1 false)
     41   call i42 @llvm.cttz.i42(i42 %d)
     42 
     43   ret void
     44 }
     45