Skip to content

Commit 9cd40da

Browse files
authored
[flang][NFC] Strip trailing whitespace from tests (7 of N)
Only some fortran source files in flang/test/Lower have been modified. The other files in the directory will be cleaned up in subsequent commits
1 parent 86a82f2 commit 9cd40da

23 files changed

+62
-62
lines changed

flang/test/Lower/assignment.f90

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ subroutine sub2(a, b)
2626
integer function negi(a)
2727
integer :: a
2828
negi = -a
29-
end
29+
end
3030

3131
! CHECK-LABEL: func @_QPnegi(
3232
! CHECK-SAME: %[[A:.*]]: !fir.ref<i32> {fir.bindc_name = "a"}) -> i32 {
@@ -41,7 +41,7 @@ integer function negi(a)
4141
real function negr(a)
4242
real :: a
4343
negr = -a
44-
end
44+
end
4545

4646
! CHECK-LABEL: func @_QPnegr(
4747
! CHECK-SAME: %[[A:.*]]: !fir.ref<f32> {fir.bindc_name = "a"}) -> f32 {
@@ -55,7 +55,7 @@ real function negr(a)
5555
complex function negc(a)
5656
complex :: a
5757
negc = -a
58-
end
58+
end
5959

6060
! CHECK-LABEL: func @_QPnegc(
6161
! CHECK-SAME: %[[A:.*]]: !fir.ref<complex<f32>> {fir.bindc_name = "a"}) -> complex<f32> {

flang/test/Lower/assumed-shape-callee.f90

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
! of making a new fir.box and this would break all these tests. In fact, for non
99
! contiguous arrays, this is the case. Find a better way to tests symbol lowering/mapping.
1010

11-
! CHECK-LABEL: func @_QPtest_assumed_shape_1(%arg0: !fir.box<!fir.array<?xi32>> {fir.bindc_name = "x", fir.contiguous})
11+
! CHECK-LABEL: func @_QPtest_assumed_shape_1(%arg0: !fir.box<!fir.array<?xi32>> {fir.bindc_name = "x", fir.contiguous})
1212
subroutine test_assumed_shape_1(x)
1313
integer, contiguous :: x(:)
1414
! CHECK: %[[addr:.*]] = fir.box_addr %arg0 : (!fir.box<!fir.array<?xi32>>) -> !fir.ref<!fir.array<?xi32>>

flang/test/Lower/assumed-shape-caller.f90

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ subroutine takes_box(y)
5959
end subroutine
6060
end interface
6161
integer :: v(:)
62-
real :: x(:)
62+
real :: x(:)
6363
call takes_box(x(v))
6464
! CHECK: %[[VAL_2:.*]] = arith.constant 1 : index
6565
! CHECK: %[[VAL_3:.*]] = arith.constant 0 : index

flang/test/Lower/big-integer-parameter.f90

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ program i128
3131

3232
! CHECK-LABEL: fir.global internal @_QFECx constant : i128 {
3333
! CHECK-NEXT: %{{.*}} = arith.constant 9223372036854775808 : i128
34-
34+
3535
! CHECK-LABEL: fir.global internal @_QFECy constant : i128 {
3636
! CHECK-NEXT: %{{.*}} = arith.constant -9223372036854775809 : i128
3737

flang/test/Lower/c-interoperability.f90

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ module c_interoperability_test
2626
end type thing_with_pointer
2727

2828
type(thing_with_pointer) :: this_thing
29-
29+
3030
contains
3131
function get_a_thing()
3232
type(thing_with_pointer) :: get_a_thing

flang/test/Lower/call-copy-in-out.f90

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ subroutine bar_intent_out(x)
120120
! CHECK: %[[cast:.*]] = fir.convert %[[addr]] : (!fir.heap<!fir.array<?xf32>>) -> !fir.ref<!fir.array<100xf32>>
121121
! CHECK: fir.call @_QPbar_intent_out(%[[cast]]) {{.*}}: (!fir.ref<!fir.array<100xf32>>) -> ()
122122
call bar_intent_out(x)
123-
123+
124124
! CHECK: fir.if %[[not_contiguous]]
125125
! CHECK: fir.call @_FortranACopyOutAssign
126126
! CHECK: return
@@ -224,7 +224,7 @@ subroutine test_char(x)
224224
! CHECK: %[[VAL_32:.*]] = fir.convert %[[TMP_BOX_REF]] : (!fir.ref<!fir.box<!fir.heap<!fir.array<?x!fir.char<1,10>>>>>) -> !fir.ref<!fir.box<none>>
225225
! CHECK: fir.call @_FortranACopyOutAssign(%[[VAL_31]], %[[VAL_32]], %{{.*}}, %{{.*}}) fastmath<contract> : (!fir.ref<!fir.box<none>>, !fir.ref<!fir.box<none>>, !fir.ref<i8>, i32) -> ()
226226
! CHECK: }
227-
227+
228228
character(10) :: x(:)
229229
call bar_char(x)
230230
! CHECK: return

flang/test/Lower/charconvert.f90

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
! RUN: bbc -emit-hlfir %s -o - | FileCheck %s
22

33
subroutine test_c1_to_c4(c4, c1)
4-
character(len=*, kind=4) :: c4
5-
character(len=*, kind=1) :: c1
6-
c4 = c1
7-
end subroutine
4+
character(len=*, kind=4) :: c4
5+
character(len=*, kind=1) :: c1
6+
c4 = c1
7+
end subroutine
88

99
subroutine test_c4_to_c1(c4, c1)
10-
character(len=*, kind=4) :: c4
11-
character(len=*, kind=1) :: c1
12-
c1 = c4
13-
end subroutine
14-
10+
character(len=*, kind=4) :: c4
11+
character(len=*, kind=1) :: c1
12+
c1 = c4
13+
end subroutine
14+
1515
! CHECK: func.func @_QPtest_c1_to_c4(%[[ARG0:.*]]: !fir.boxchar<4> {fir.bindc_name = "c4"}, %[[ARG1:.*]]: !fir.boxchar<1> {fir.bindc_name = "c1"}) {
1616
! CHECK: %[[VAL_0:.*]]:2 = fir.unboxchar %[[ARG1]] : (!fir.boxchar<1>) -> (!fir.ref<!fir.char<1,?>>, index)
1717
! CHECK: %[[VAL_1:.*]]:2 = hlfir.declare %[[VAL_0]]#0 typeparams %[[VAL_0]]#1 dummy_scope %{{[0-9]+}} arg {{[0-9]+}} {uniq_name = "_QFtest_c1_to_c4Ec1"} : (!fir.ref<!fir.char<1,?>>, index, !fir.dscope) -> (!fir.boxchar<1>, !fir.ref<!fir.char<1,?>>)

flang/test/Lower/control-flow.f90

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,4 @@ subroutine one(a,b,c)
2222
! CHECK: ^bb[[EXIT]]:
2323
! CHECK-NEXT: return
2424
end subroutine one
25-
25+

flang/test/Lower/default-initialization.f90

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@
33

44
module test_dinit
55
type t
6-
integer :: i = 42
6+
integer :: i = 42
77
end type
88
type t_alloc_comp
99
real, allocatable :: i(:)
1010
end type
1111
type tseq
1212
sequence
13-
integer :: i = 42
13+
integer :: i = 42
1414
end type
1515
contains
1616

@@ -26,7 +26,7 @@ subroutine local
2626
!CHECK: fir.copy %[[ADDR]] to %[[x]] no_overlap : !fir.ref<!fir.type<_QMtest_dinitTt{i:i32}>>, !fir.ref<!fir.type<_QMtest_dinitTt{i:i32}>>
2727
type(t) :: x
2828
print *, x%i
29-
end subroutine
29+
end subroutine
3030

3131
! Test local array is default initialized
3232
! CHECK-LABEL: func @_QMtest_dinitPlocal_array()
@@ -38,7 +38,7 @@ subroutine local_array()
3838
! CHECK: fir.call @_FortranAInitialize(%[[xboxNone]], %{{.*}}, %{{.*}}) {{.*}}: (!fir.box<none>, !fir.ref<i8>, i32) -> ()
3939
type(t) :: x(4)
4040
print *, x(2)%i
41-
end subroutine
41+
end subroutine
4242

4343
! Test allocatable component triggers default initialization of local
4444
! scalars.
@@ -48,7 +48,7 @@ subroutine local_alloc_comp
4848
!CHECK: %[[ADDR:.*]] = fir.address_of(@_QQ_QMtest_dinitTt_alloc_comp.DerivedInit) : !fir.ref<!fir.type<_QMtest_dinitTt_alloc_comp{i:!fir.box<!fir.heap<!fir.array<?xf32>>>}>>
4949
!CHECK: fir.copy %[[ADDR]] to %[[x]] no_overlap : !fir.ref<!fir.type<_QMtest_dinitTt_alloc_comp{i:!fir.box<!fir.heap<!fir.array<?xf32>>>}>>, !fir.ref<!fir.type<_QMtest_dinitTt_alloc_comp{i:!fir.box<!fir.heap<!fir.array<?xf32>>>}>>
5050
type(t_alloc_comp) :: x
51-
end subroutine
51+
end subroutine
5252

5353
! Test function results are default initialized.
5454
! CHECK-LABEL: func @_QMtest_dinitPresult() -> !fir.type<_QMtest_dinitTt{i:i32}>
@@ -110,7 +110,7 @@ subroutine local_eq2()
110110
! CHECK: %[[ADDR:.*]] = fir.address_of(@_QQ_QMtest_dinitTtseq.DerivedInit) : !fir.ref<!fir.type<_QMtest_dinitTtseq{i:i32}>>
111111
! CHECK: fir.copy %[[ADDR]] to %[[x]] no_overlap : !fir.ref<!fir.type<_QMtest_dinitTtseq{i:i32}>>, !fir.ptr<!fir.type<_QMtest_dinitTtseq{i:i32}>>
112112

113-
113+
114114
! CHECK: %[[ycoor:.*]] = fir.coordinate_of %[[equiv]], %c0{{.*}} : (!fir.ref<!fir.array<4xi8>>, index) -> !fir.ref<i8>
115115
! CHECK: %[[y:.*]] = fir.convert %[[ycoor]] : (!fir.ref<i8>) -> !fir.ptr<!fir.type<_QMtest_dinitTtseq{i:i32}>>
116116
! CHECK: %[[ADDR:.*]] = fir.address_of(@_QQ_QMtest_dinitTtseq.DerivedInit) : !fir.ref<!fir.type<_QMtest_dinitTtseq{i:i32}>>
@@ -129,14 +129,14 @@ subroutine noinit_local_alloc
129129
! CHECK-NOT: fir.call @_FortranAInitialize
130130
type(t), allocatable :: x
131131
! CHECK: return
132-
end subroutine
132+
end subroutine
133133

134134
! CHECK-LABEL: func @_QMtest_dinitPnoinit_local_pointer
135135
subroutine noinit_local_pointer
136136
! CHECK-NOT: fir.call @_FortranAInitialize
137137
type(t), pointer :: x
138138
! CHECK: return
139-
end subroutine
139+
end subroutine
140140

141141
! CHECK-LABEL: func @_QMtest_dinitPnoinit_normal_dummy
142142
subroutine noinit_normal_dummy(x)
@@ -150,7 +150,7 @@ subroutine noinit_intentinout_dummy(x)
150150
! CHECK-NOT: fir.call @_FortranAInitialize
151151
type(t), intent(inout) :: x
152152
! CHECK: return
153-
end subroutine
153+
end subroutine
154154

155155

156156
subroutine test_pointer_intentout(a, b)

flang/test/Lower/derived-allocatable-components.f90

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -241,9 +241,9 @@ subroutine ref_scalar_def_char_a(a0_0, a1_0, a0_1, a1_1)
241241
! CHECK-DAG: %[[len:.*]] = fir.box_elesize %[[box]]
242242
! CHECK-DAG: %[[base:.*]] = fir.box_addr %[[box]]
243243
! CHECK: %[[cast:.*]] = fir.convert %[[base]] : (!fir.heap<!fir.array<?x!fir.char<1,?>>>) -> !fir.ref<!fir.array<?x!fir.char<1,?>>>
244-
! CHECK: %[[c7:.*]] = fir.convert %c7{{.*}} : (i64) -> index
245-
! CHECK: %[[sub:.*]] = arith.subi %[[c7]], %[[dims]]#0 : index
246-
! CHECK: %[[mul:.*]] = arith.muli %[[len]], %[[sub]] : index
244+
! CHECK: %[[c7:.*]] = fir.convert %c7{{.*}} : (i64) -> index
245+
! CHECK: %[[sub:.*]] = arith.subi %[[c7]], %[[dims]]#0 : index
246+
! CHECK: %[[mul:.*]] = arith.muli %[[len]], %[[sub]] : index
247247
! CHECK: %[[offset:.*]] = arith.addi %[[mul]], %c0{{.*}} : index
248248
! CHECK: %[[cnvt:.*]] = fir.convert %[[cast]]
249249
! CHECK: %[[addr:.*]] = fir.coordinate_of %[[cnvt]], %[[offset]]
@@ -260,9 +260,9 @@ subroutine ref_scalar_def_char_a(a0_0, a1_0, a0_1, a1_1)
260260
! CHECK-DAG: %[[len:.*]] = fir.box_elesize %[[box]]
261261
! CHECK-DAG: %[[base:.*]] = fir.box_addr %[[box]]
262262
! CHECK: %[[cast:.*]] = fir.convert %[[base]] : (!fir.heap<!fir.array<?x!fir.char<1,?>>>) -> !fir.ref<!fir.array<?x!fir.char<1,?>>>
263-
! CHECK: %[[c7:.*]] = fir.convert %c7{{.*}} : (i64) -> index
264-
! CHECK: %[[sub:.*]] = arith.subi %[[c7]], %[[dims]]#0 : index
265-
! CHECK: %[[mul:.*]] = arith.muli %[[len]], %[[sub]] : index
263+
! CHECK: %[[c7:.*]] = fir.convert %c7{{.*}} : (i64) -> index
264+
! CHECK: %[[sub:.*]] = arith.subi %[[c7]], %[[dims]]#0 : index
265+
! CHECK: %[[mul:.*]] = arith.muli %[[len]], %[[sub]] : index
266266
! CHECK: %[[offset:.*]] = arith.addi %[[mul]], %c0{{.*}} : index
267267
! CHECK: %[[cnvt:.*]] = fir.convert %[[cast]]
268268
! CHECK: %[[addr:.*]] = fir.coordinate_of %[[cnvt]], %[[offset]]

0 commit comments

Comments
 (0)