Skip to content

Commit a12600c

Browse files
authored
[flang][NFC] Strip trailing whitespace from tests (4 of N)
Only the fortran source files in flang/test/Intrinsics have been modified. The other files in flang/test will be cleaned up in subsequent commits
1 parent 1bd035d commit a12600c

35 files changed

+89
-98
lines changed

flang/test/Lower/Intrinsics/adjustl.f90

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,3 @@ subroutine adjustl_test
1616
! CHECK: fir.call @_FortranAAdjustl(%[[r3]], %[[r4]], %[[r5]], %{{.*}}) {{.*}}: (!fir.ref<!fir.box<none>>, !fir.box<none>, !fir.ref<i8>, i32) -> ()
1717
adjust_str = adjustl(adjust_str)
1818
end subroutine
19-

flang/test/Lower/Intrinsics/adjustr.f90

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,3 @@ subroutine adjustr_test
1616
! CHECK: fir.call @_FortranAAdjustr(%[[r3]], %[[r4]], %[[r5]], %{{.*}}) {{.*}}: (!fir.ref<!fir.box<none>>, !fir.box<none>, !fir.ref<i8>, i32) -> ()
1717
adjust_str = adjustr(adjust_str)
1818
end subroutine
19-

flang/test/Lower/Intrinsics/associated.f90

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,11 @@ subroutine associated_test(scalar, array)
2323
! CHECK: fir.call @_FortranAPointerIsAssociatedWith(%[[sbox]], %[[zbox]]) {{.*}}: (!fir.box<none>, !fir.box<none>) -> i1
2424
print *, associated(scalar, ziel)
2525
end subroutine
26-
26+
2727
subroutine test_func_results()
2828
interface
2929
function get_pointer()
30-
real, pointer :: get_pointer(:)
30+
real, pointer :: get_pointer(:)
3131
end function
3232
end interface
3333
! CHECK: %[[result:.*]] = fir.call @_QPget_pointer() {{.*}}: () -> !fir.box<!fir.ptr<!fir.array<?xf32>>>
@@ -38,7 +38,7 @@ function get_pointer()
3838
! CHECK: arith.cmpi ne, %[[addr_cast]], %c0{{.*}} : i64
3939
print *, associated(get_pointer())
4040
end subroutine
41-
41+
4242
! CHECK-LABEL: func @_QPtest_optional_target_1(
4343
! CHECK-SAME: %[[VAL_0:.*]]: !fir.ref<!fir.box<!fir.ptr<!fir.array<?xf32>>>> {fir.bindc_name = "p"},
4444
! CHECK-SAME: %[[VAL_1:.*]]: !fir.ref<!fir.array<10xf32>> {fir.bindc_name = "optionales_ziel", fir.optional, fir.target}) {
@@ -61,7 +61,7 @@ subroutine test_optional_target_1(p, optionales_ziel)
6161
! CHECK: %[[VAL_15:.*]] = fir.convert %[[VAL_4]] : (!fir.box<!fir.array<10xf32>>) -> !fir.box<none>
6262
! CHECK: fir.call @_FortranAPointerIsAssociatedWith(%[[VAL_14]], %[[VAL_15]]) {{.*}}: (!fir.box<none>, !fir.box<none>) -> i1
6363
end subroutine
64-
64+
6565
! CHECK-LABEL: func @_QPtest_optional_target_2(
6666
! CHECK-SAME: %[[VAL_0:.*]]: !fir.ref<!fir.box<!fir.ptr<!fir.array<?xf32>>>> {fir.bindc_name = "p"},
6767
! CHECK-SAME: %[[VAL_1:.*]]: !fir.box<!fir.array<?xf32>> {fir.bindc_name = "optionales_ziel", fir.optional, fir.target}) {
@@ -81,7 +81,7 @@ subroutine test_optional_target_2(p, optionales_ziel)
8181
! CHECK: %[[VAL_12:.*]] = fir.convert %[[VAL_8]] : (!fir.box<!fir.array<?xf32>>) -> !fir.box<none>
8282
! CHECK: fir.call @_FortranAPointerIsAssociatedWith(%[[VAL_11]], %[[VAL_12]]) {{.*}}: (!fir.box<none>, !fir.box<none>) -> i1
8383
end subroutine
84-
84+
8585
! CHECK-LABEL: func @_QPtest_optional_target_3(
8686
! CHECK-SAME: %[[VAL_0:.*]]: !fir.ref<!fir.box<!fir.ptr<!fir.array<?xf32>>>> {fir.bindc_name = "p"},
8787
! CHECK-SAME: %[[VAL_1:.*]]: !fir.ref<!fir.box<!fir.ptr<!fir.array<?xf32>>>> {fir.bindc_name = "optionales_ziel", fir.optional}) {
@@ -102,7 +102,7 @@ subroutine test_optional_target_3(p, optionales_ziel)
102102
! CHECK: %[[VAL_13:.*]] = fir.convert %[[VAL_9]] : (!fir.box<!fir.ptr<!fir.array<?xf32>>>) -> !fir.box<none>
103103
! CHECK: fir.call @_FortranAPointerIsAssociatedWith(%[[VAL_12]], %[[VAL_13]]) {{.*}}: (!fir.box<none>, !fir.box<none>) -> i1
104104
end subroutine
105-
105+
106106
! CHECK-LABEL: func @_QPtest_optional_target_4(
107107
! CHECK-SAME: %[[VAL_0:.*]]: !fir.ref<!fir.box<!fir.ptr<!fir.array<?xf32>>>> {fir.bindc_name = "p"},
108108
! CHECK-SAME: %[[VAL_1:.*]]: !fir.ref<!fir.box<!fir.heap<!fir.array<?xf32>>>> {fir.bindc_name = "optionales_ziel", fir.optional, fir.target}) {
@@ -123,7 +123,7 @@ subroutine test_optional_target_4(p, optionales_ziel)
123123
! CHECK: %[[VAL_13:.*]] = fir.convert %[[VAL_9]] : (!fir.box<!fir.heap<!fir.array<?xf32>>>) -> !fir.box<none>
124124
! CHECK: fir.call @_FortranAPointerIsAssociatedWith(%[[VAL_12]], %[[VAL_13]]) {{.*}}: (!fir.box<none>, !fir.box<none>) -> i1
125125
end subroutine
126-
126+
127127
! CHECK-LABEL: func @_QPtest_pointer_target(
128128
! CHECK-SAME: %[[VAL_0:.*]]: !fir.ref<!fir.box<!fir.ptr<!fir.array<?xf32>>>> {fir.bindc_name = "p"},
129129
! CHECK-SAME: %[[VAL_1:.*]]: !fir.ref<!fir.box<!fir.ptr<!fir.array<?xf32>>>> {fir.bindc_name = "pointer_ziel"}) {
@@ -137,7 +137,7 @@ subroutine test_pointer_target(p, pointer_ziel)
137137
! CHECK: %[[VAL_10:.*]] = fir.convert %[[VAL_7]] : (!fir.box<!fir.ptr<!fir.array<?xf32>>>) -> !fir.box<none>
138138
! CHECK: fir.call @_FortranAPointerIsAssociatedWith(%[[VAL_9]], %[[VAL_10]]) {{.*}}: (!fir.box<none>, !fir.box<none>) -> i1
139139
end subroutine
140-
140+
141141
! CHECK-LABEL: func @_QPtest_allocatable_target(
142142
! CHECK-SAME: %[[VAL_0:.*]]: !fir.ref<!fir.box<!fir.ptr<!fir.array<?xf32>>>> {fir.bindc_name = "p"},
143143
! CHECK-SAME: %[[VAL_1:.*]]: !fir.ref<!fir.box<!fir.heap<!fir.array<?xf32>>>> {fir.bindc_name = "allocatable_ziel", fir.target}) {

flang/test/Lower/Intrinsics/btest.f90

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,3 @@ function btest_test(i, j)
1515
! CHECK: return %[[VAL_9]] : !fir.logical<4>
1616
btest_test = btest(i, j)
1717
end
18-

flang/test/Lower/Intrinsics/ceiling.f90

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,3 @@ subroutine ceiling_test2(i, a)
1616
! CHECK: %[[f:.*]] = math.ceil %{{.*}} : f32
1717
! CHECK: fir.convert %[[f]] : (f32) -> i64
1818
end subroutine
19-
20-

flang/test/Lower/Intrinsics/count.f90

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ subroutine count_test1(rslt, mask)
1111
rslt = count(mask)
1212
! CHECK: %[[a5:.*]] = fir.call @_FortranACount(%[[a2]], %{{.*}}, %{{.*}}, %[[a4]]) {{.*}}: (!fir.box<none>, !fir.ref<i8>, i32, i32) -> i64
1313
end subroutine
14-
14+
1515
! CHECK-LABEL: test_count2
1616
! CHECK-SAME: %[[arg0:.*]]: !fir.box<!fir.array<?xi32>>{{.*}}, %[[arg1:.*]]: !fir.box<!fir.array<?x?x!fir.logical<4>>>{{.*}})
1717
subroutine test_count2(rslt, mask)
@@ -29,7 +29,7 @@ subroutine test_count2(rslt, mask)
2929
! CHECK: %[[a12:.*]] = fir.box_addr %[[a10]] : (!fir.box<!fir.heap<!fir.array<?xi32>>>) -> !fir.heap<!fir.array<?xi32>>
3030
! CHECK: fir.freemem %[[a12]]
3131
end subroutine
32-
32+
3333
! CHECK-LABEL: test_count3
3434
! CHECK-SAME: %[[arg0:.*]]: !fir.ref<i32>{{.*}}, %[[arg1:.*]]: !fir.box<!fir.array<?x!fir.logical<4>>>{{.*}})
3535
subroutine test_count3(rslt, mask)

flang/test/Lower/Intrinsics/cpu_time.f90

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,3 @@ subroutine cpu_time_test(t)
88
! CHECK: fir.store %[[result32]] to %arg0 : !fir.ref<f32>
99
call cpu_time(t)
1010
end subroutine
11-

flang/test/Lower/Intrinsics/date_and_time.f90

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,13 @@ subroutine date_and_time_test(date, time, zone, values)
1818
! CHECK: fir.call @_FortranADateAndTime(%[[dateBuffer]], %[[dateLen]], %[[timeBuffer]], %[[timeLen]], %[[zoneBuffer]], %[[zoneLen]], %{{.*}}, %{{.*}}, %[[valuesCast]]) {{.*}}: (!fir.ref<i8>, i64, !fir.ref<i8>, i64, !fir.ref<i8>, i64, !fir.ref<i8>, i32, !fir.box<none>) -> ()
1919
call date_and_time(date, time, zone, values)
2020
end subroutine
21-
21+
2222
! CHECK-LABEL: func @_QPdate_and_time_test2(
2323
! CHECK-SAME: %[[date:.*]]: !fir.boxchar<1>{{.*}})
2424
subroutine date_and_time_test2(date)
2525
character(*) :: date
2626
! CHECK: %[[dateUnbox:.*]]:2 = fir.unboxchar %[[date]] : (!fir.boxchar<1>) -> (!fir.ref<!fir.char<1,?>>, index)
27-
! CHECK: %[[values:.*]] = fir.absent !fir.box<none>
27+
! CHECK: %[[values:.*]] = fir.absent !fir.box<none>
2828
! CHECK: %[[dateBuffer:.*]] = fir.convert %[[dateUnbox]]#0 : (!fir.ref<!fir.char<1,?>>) -> !fir.ref<i8>
2929
! CHECK: %[[dateLen:.*]] = fir.convert %[[dateUnbox]]#1 : (index) -> i64
3030
! CHECK: %[[timeBuffer:.*]] = fir.convert %c0{{.*}} : (index) -> !fir.ref<i8>
@@ -34,7 +34,7 @@ subroutine date_and_time_test2(date)
3434
! CHECK: fir.call @_FortranADateAndTime(%[[dateBuffer]], %[[dateLen]], %[[timeBuffer]], %[[timeLen]], %[[zoneBuffer]], %[[zoneLen]], %{{.*}}, %{{.*}}, %[[values]]) {{.*}}: (!fir.ref<i8>, i64, !fir.ref<i8>, i64, !fir.ref<i8>, i64, !fir.ref<i8>, i32, !fir.box<none>) -> ()
3535
call date_and_time(date)
3636
end subroutine
37-
37+
3838
! CHECK-LABEL: func @_QPdate_and_time_dynamic_optional(
3939
! CHECK-SAME: %[[VAL_0:[^:]*]]: !fir.boxchar<1>
4040
! CHECK-SAME: %[[VAL_1:.*]]: !fir.ref<!fir.box<!fir.ptr<!fir.char<1,?>>>>

flang/test/Lower/Intrinsics/eoshift.f90

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,16 @@ subroutine eoshift_test1(arr, shift)
1313
! CHECK: fir.store %[[init]] to %[[resBox]] : !fir.ref<!fir.box<!fir.heap<!fir.array<?x!fir.logical<4>>>>>
1414
! CHECK: %[[boundBox:.*]] = fir.absent !fir.box<none>
1515
! CHECK: %[[shift:.*]] = fir.load %arg1 : !fir.ref<i32>
16-
16+
1717
res = eoshift(arr, shift)
18-
18+
1919
! CHECK: %[[resIRBox:.*]] = fir.convert %[[resBox]] : (!fir.ref<!fir.box<!fir.heap<!fir.array<?x!fir.logical<4>>>>>) -> !fir.ref<!fir.box<none>>
2020
! CHECK: %[[arrBox:.*]] = fir.convert %[[arr]] : (!fir.box<!fir.array<3x!fir.logical<4>>>) -> !fir.box<none>
2121
! CHECK: %[[shiftBox:.*]] = fir.convert %[[shift]] : (i32) -> i64
2222
! CHECK: fir.call @_FortranAEoshiftVector(%[[resIRBox]], %[[arrBox]], %[[shiftBox]], %[[boundBox]], {{.*}}, {{.*}}) {{.*}}: (!fir.ref<!fir.box<none>>, !fir.box<none>, i64, !fir.box<none>, !fir.ref<i8>, i32) -> ()
2323
! CHECK: fir.array_merge_store %[[resLoad]], {{.*}} to %[[res]] : !fir.array<3x!fir.logical<4>>, !fir.array<3x!fir.logical<4>>, !fir.ref<!fir.array<3x!fir.logical<4>>>
2424
end subroutine eoshift_test1
25-
25+
2626
! CHECK-LABEL: eoshift_test2
2727
subroutine eoshift_test2(arr, shift, bound, dim)
2828
integer, dimension(3,3) :: arr, res
@@ -31,9 +31,9 @@ subroutine eoshift_test2(arr, shift, bound, dim)
3131
! CHECK: %[[resBox:.*]] = fir.alloca !fir.box<!fir.heap<!fir.array<?x?xi32>>>
3232
! CHECK: %[[res:.*]] = fir.alloca !fir.array<3x3xi32> {bindc_name = "res", uniq_name = "_QFeoshift_test2Eres"}
3333
!CHECK: %[[resLoad:.*]] = fir.array_load %[[res]]({{.*}}) : (!fir.ref<!fir.array<3x3xi32>>, !fir.shape<2>) -> !fir.array<3x3xi32>
34-
34+
3535
res = eoshift(arr, shift, bound, dim)
36-
36+
3737
! CHECK: %[[arr:.*]] = fir.embox %arg0({{.*}}) : (!fir.ref<!fir.array<3x3xi32>>, !fir.shape<2>) -> !fir.box<!fir.array<3x3xi32>>
3838
! CHECK: %[[boundBox:.*]] = fir.embox %arg2 : (!fir.ref<i32>) -> !fir.box<i32>
3939
! CHECK: %[[dim:.*]] = fir.load %arg3 : !fir.ref<i32>
@@ -42,26 +42,26 @@ subroutine eoshift_test2(arr, shift, bound, dim)
4242
! CHECK: %[[arrBox:.*]] = fir.convert %[[arr]] : (!fir.box<!fir.array<3x3xi32>>) -> !fir.box<none>
4343
! CHECK: %[[shiftBoxNone:.*]] = fir.convert %[[shiftBox]] : (!fir.box<!fir.array<3xi32>>) -> !fir.box<none>
4444
! CHECK: %[[boundBoxNone:.*]] = fir.convert %[[boundBox]] : (!fir.box<i32>) -> !fir.box<none>
45-
45+
4646
! CHECK: fir.call @_FortranAEoshift(%[[resIRBox]], %[[arrBox]], %[[shiftBoxNone]], %[[boundBoxNone]], %[[dim]], {{.*}}, {{.*}}) {{.*}}: (!fir.ref<!fir.box<none>>, !fir.box<none>, !fir.box<none>, !fir.box<none>, i32, !fir.ref<i8>, i32) -> ()
4747
! CHECK: fir.array_merge_store %[[resLoad]], {{.*}} to %[[res]] : !fir.array<3x3xi32>, !fir.array<3x3xi32>, !fir.ref<!fir.array<3x3xi32>>
4848
end subroutine eoshift_test2
49-
49+
5050
! CHECK-LABEL: eoshift_test3
5151
subroutine eoshift_test3(arr, shift, dim)
5252
character(4), dimension(3,3) :: arr, res
5353
integer :: shift, dim
54-
54+
5555
! CHECK: %[[resBox:.*]] = fir.alloca !fir.box<!fir.heap<!fir.array<?x?x!fir.char<1,4>>>>
5656
! CHECK: %[[arr:.*]]:2 = fir.unboxchar %arg0 : (!fir.boxchar<1>) -> (!fir.ref<!fir.char<1,?>>, index)
5757
! CHECK: %[[array:.*]] = fir.convert %[[arr]]#0 : (!fir.ref<!fir.char<1,?>>) -> !fir.ref<!fir.array<3x3x!fir.char<1,4>>>
5858
! CHECK: %[[res:.*]] = fir.alloca !fir.array<3x3x!fir.char<1,4>> {bindc_name = "res", uniq_name = "_QFeoshift_test3Eres"}
5959
! CHECK: %[[resLoad:.*]] = fir.array_load %[[res]]({{.*}}) : (!fir.ref<!fir.array<3x3x!fir.char<1,4>>>, !fir.shape<2>) -> !fir.array<3x3x!fir.char<1,4>>
6060
! CHECK: %[[arrayBox:.*]] = fir.embox %[[array]]({{.*}}) : (!fir.ref<!fir.array<3x3x!fir.char<1,4>>>, !fir.shape<2>) -> !fir.box<!fir.array<3x3x!fir.char<1,4>>>
6161
! CHECK: %[[dim:.*]] = fir.load %arg2 : !fir.ref<i32>
62-
62+
6363
res = eoshift(arr, SHIFT=shift, DIM=dim)
64-
64+
6565
! CHECK: %[[boundBox:.*]] = fir.absent !fir.box<none>
6666
! CHECK: %[[shiftBox:.*]] = fir.embox %arg1 : (!fir.ref<i32>) -> !fir.box<i32>
6767
! CHECK: %[[resIRBox:.*]] = fir.convert %[[resBox]] : (!fir.ref<!fir.box<!fir.heap<!fir.array<?x?x!fir.char<1,4>>>>>) -> !fir.ref<!fir.box<none>>
@@ -70,7 +70,7 @@ subroutine eoshift_test3(arr, shift, dim)
7070
! CHECK: fir.call @_FortranAEoshift(%[[resIRBox]], %[[arrayBoxNone]], %[[shiftBoxNone]], %[[boundBox]], %[[dim]], {{.*}}, {{.*}}) {{.*}}: (!fir.ref<!fir.box<none>>, !fir.box<none>, !fir.box<none>, !fir.box<none>, i32, !fir.ref<i8>, i32) -> ()
7171
! CHECK: fir.array_merge_store %[[resLoad]], {{.*}} to %[[res]] : !fir.array<3x3x!fir.char<1,4>>, !fir.array<3x3x!fir.char<1,4>>, !fir.ref<!fir.array<3x3x!fir.char<1,4>>>
7272
end subroutine eoshift_test3
73-
73+
7474
! CHECK-LABEL: func @_QPeoshift_test_dynamic_optional(
7575
! CHECK-SAME: %[[VAL_0:.*]]: !fir.box<!fir.array<?x?xi32>>
7676
! CHECK-SAME: %[[VAL_1:.*]]: !fir.ref<i32>

flang/test/Lower/Intrinsics/execute_command_line-optional.f90

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ subroutine all_args_optional(command, isWait, exitVal, cmdVal, msg)
1212
LOGICAL, OPTIONAL :: isWait
1313
! Note: command is not optional in execute_command_line and must be present
1414
call execute_command_line(command, isWait, exitVal, cmdVal, msg)
15-
! CHECK-NEXT: %[[c14:.*]] = arith.constant 14 : i32
16-
! CHECK-NEXT: %true = arith.constant true
17-
! CHECK-NEXT: %[[c0:.*]] = arith.constant 0 : i64
15+
! CHECK-NEXT: %[[c14:.*]] = arith.constant 14 : i32
16+
! CHECK-NEXT: %true = arith.constant true
17+
! CHECK-NEXT: %[[c0:.*]] = arith.constant 0 : i64
1818
! CHECK-NEXT: %[[DSCOPE:.*]] = fir.dummy_scope : !fir.dscope
1919
! CHECK-NEXT: %[[cmdstatDeclare:.*]] = fir.declare %[[cmdstatArg]] dummy_scope %[[DSCOPE]] arg {{[0-9]+}} {fortran_attrs = #fir.var_attrs<optional>, uniq_name = "_QFall_args_optionalEcmdval"} : (!fir.ref<i32>, !fir.dscope) -> !fir.ref<i32>
2020
! CHECK-NEXT: %[[commandUnbox:.*]]:2 = fir.unboxchar %[[commandArg]] : (!fir.boxchar<1>) -> (!fir.ref<!fir.char<1,?>>, index)
@@ -35,7 +35,7 @@ subroutine all_args_optional(command, isWait, exitVal, cmdVal, msg)
3535
! CHECK-NEXT: %[[cmdstatArgBox:.*]] = fir.embox %[[cmdstatDeclare]] : (!fir.ref<i32>) -> !fir.box<i32>
3636
! CHECK-NEXT: %[[cmdstatBox:.*]] = arith.select %[[cmdstatIsPresent]], %[[cmdstatArgBox]], %[[absentBoxi32]] : !fir.box<i32>
3737
! CHECK-NEXT: %[[cmdmsgArgBox:.*]] = fir.embox %[[cmdmsgDeclare]] typeparams %[[cmdmsgUnbox]]#1 : (!fir.ref<!fir.char<1,?>>, index) -> !fir.box<!fir.char<1,?>>
38-
! CHECK-NEXT: %[[absentBox:.*]] = fir.absent !fir.box<!fir.char<1,?>>
38+
! CHECK-NEXT: %[[absentBox:.*]] = fir.absent !fir.box<!fir.char<1,?>>
3939
! CHECK-NEXT: %[[cmdmsgBox:.*]] = arith.select %[[cmdmsgIsPresent]], %[[cmdmsgArgBox]], %[[absentBox]] : !fir.box<!fir.char<1,?>>
4040
! CHECK-NEXT: %[[waitCast:.*]] = fir.convert %[[waitDeclare]] : (!fir.ref<!fir.logical<4>>) -> i64
4141
! CHECK-NEXT: %[[waitPresent:.*]] = arith.cmpi ne, %[[waitCast]], %[[c0]] : i64

0 commit comments

Comments
 (0)