diff options
author | Wang Pengcheng <wangpengcheng.pp@bytedance.com> | 2024-04-17 21:47:29 +0800 |
---|---|---|
committer | Wang Pengcheng <wangpengcheng.pp@bytedance.com> | 2024-04-17 21:47:29 +0800 |
commit | 7d1b70a3960cdacfa4d7531531a9a921dadd3d88 (patch) | |
tree | ac207bdf9fcb3c3656deafb734acd8f03b40c8db /flang/test/Lower/character-elemental.f90 | |
parent | c9d96c0d77b67c208aaf7f8f2554f972baa412d2 (diff) | |
parent | e77f6742143d71161f3f1161270648c9b95b2137 (diff) | |
download | llvm-users/wangpc-pp/spr/riscv-dont-use-v0-directly-in-patterns.zip llvm-users/wangpc-pp/spr/riscv-dont-use-v0-directly-in-patterns.tar.gz llvm-users/wangpc-pp/spr/riscv-dont-use-v0-directly-in-patterns.tar.bz2 |
Rebase on #88868users/wangpc-pp/spr/riscv-dont-use-v0-directly-in-patterns
Created using spr 1.3.6-beta.1
Diffstat (limited to 'flang/test/Lower/character-elemental.f90')
-rw-r--r-- | flang/test/Lower/character-elemental.f90 | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/flang/test/Lower/character-elemental.f90 b/flang/test/Lower/character-elemental.f90 index 6c46454..9a9cf8bf 100644 --- a/flang/test/Lower/character-elemental.f90 +++ b/flang/test/Lower/character-elemental.f90 @@ -5,6 +5,12 @@ subroutine substring_main character*7 :: string(2) = ['12 ', '12 '] integer :: result(2) integer :: ival +interface + elemental function inner(arg) + character(len=*), intent(in) :: arg + integer :: inner + end function inner +end interface ival = 1 ! CHECK: %[[a0:.*]] = fir.alloca i32 {bindc_name = "ival", uniq_name = "_QFsubstring_mainEival"} @@ -26,14 +32,7 @@ subroutine substring_main ! CHECK: %[[a14:.*]] = fir.coordinate_of %[[a13]], %[[a12]] : (!fir.ref<!fir.array<7x!fir.char<1>>>, index) -> !fir.ref<!fir.char<1>> ! CHECK: %[[a15:.*]] = fir.convert %[[a14]] : (!fir.ref<!fir.char<1>>) -> !fir.ref<!fir.char<1,?>> ! CHECK: %[[a16:.*]] = fir.emboxchar %[[a15]], {{.*}} : (!fir.ref<!fir.char<1,?>>, index) -> !fir.boxchar<1> - ! CHECK: %[[a17:.*]] = fir.call @_QFsubstring_mainPinner(%[[a16]]) {{.*}}: (!fir.boxchar<1>) -> i32 + ! CHECK: %[[a17:.*]] = fir.call @_QPinner(%[[a16]]) {{.*}}: (!fir.boxchar<1>) -> i32 result = inner(string(1:2)(ival:ival)) print *, result -contains - elemental function inner(arg) - character(len=*), intent(in) :: arg - integer :: inner - - inner = len(arg) - end function inner end subroutine substring_main |