Skip to content

Commit 161e8a4

Browse files
SC llvm teamSC llvm team
SC llvm team
authored and
SC llvm team
committed
Merged main:2ab14dff4355 into amd-gfx:1c0d172f4b27
Local branch amd-gfx 1c0d172 Merged main:157ba33007fe into amd-gfx:f5e3081cf03f Remote branch main 2ab14df [mlir][python] fix python_test dialect and I32/I64ElementsBuilder (llvm#70871)
2 parents 1c0d172 + 2ab14df commit 161e8a4

File tree

36 files changed

+511
-187
lines changed

36 files changed

+511
-187
lines changed

flang/docs/Extensions.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,8 @@ end
222222
we also treat scalars as being trivially contiguous, so that they
223223
can be used in contexts like data targets in pointer assignments
224224
with bounds remapping.
225+
* The `CONTIGUOUS` attribute can be redundantly applied to simply
226+
contiguous objects, including scalars, with a portability warning.
225227
* We support some combinations of specific procedures in generic
226228
interfaces that a strict reading of the standard would preclude
227229
when their calls must nonetheless be distinguishable.

flang/lib/Semantics/check-declarations.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2129,11 +2129,11 @@ void CheckHelper::CheckContiguous(const Symbol &symbol) {
21292129
evaluate::IsAssumedRank(symbol))) {
21302130
} else if (symbol.owner().IsDerivedType()) { // C752
21312131
messages_.Say(
2132-
"CONTIGUOUS component '%s' must be an array with the POINTER attribute"_err_en_US,
2132+
"CONTIGUOUS component '%s' should be an array with the POINTER attribute"_port_en_US,
21332133
symbol.name());
21342134
} else {
21352135
messages_.Say(
2136-
"CONTIGUOUS entity '%s' must be an array pointer, assumed-shape, or assumed-rank"_err_en_US,
2136+
"CONTIGUOUS entity '%s' should be an array pointer, assumed-shape, or assumed-rank"_port_en_US,
21372137
symbol.name());
21382138
}
21392139
}

flang/test/Semantics/bind-c13.f90

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
! RUN: %python %S/test_errors.py %s %flang_fc1
1+
! RUN: %python %S/test_errors.py %s %flang_fc1 -pedantic
22
! Interoperable objects that require descriptors cannot be CONTIGUOUS
33
subroutine interop(ptr,ashape,arank,eshape,asize) bind(c)
44
!ERROR: An interoperable pointer must not be CONTIGUOUS
55
real, pointer, contiguous :: ptr(:)
66
real, contiguous :: ashape(:) ! ok
77
real, contiguous :: arank(..) ! ok
8-
!ERROR: CONTIGUOUS entity 'eshape' must be an array pointer, assumed-shape, or assumed-rank
8+
!PORTABILITY: CONTIGUOUS entity 'eshape' should be an array pointer, assumed-shape, or assumed-rank
99
real, contiguous :: eshape(10)
10-
!ERROR: CONTIGUOUS entity 'asize' must be an array pointer, assumed-shape, or assumed-rank
10+
!PORTABILITY: CONTIGUOUS entity 'asize' should be an array pointer, assumed-shape, or assumed-rank
1111
real, contiguous :: asize(*)
1212
end

flang/test/Semantics/call07.f90

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,12 @@ subroutine s04(p)
1919
end subroutine
2020

2121
subroutine test
22-
!ERROR: CONTIGUOUS entity 'a01' must be an array pointer, assumed-shape, or assumed-rank
22+
!PORTABILITY: CONTIGUOUS entity 'a01' should be an array pointer, assumed-shape, or assumed-rank
2323
real, pointer, contiguous :: a01 ! C830
2424
real, pointer :: a02(:)
2525
real, target :: a03(10)
2626
real :: a04(10) ! not TARGET
27-
!ERROR: CONTIGUOUS entity 'scalar' must be an array pointer, assumed-shape, or assumed-rank
27+
!PORTABILITY: CONTIGUOUS entity 'scalar' should be an array pointer, assumed-shape, or assumed-rank
2828
real, contiguous :: scalar
2929
call s01(a03) ! ok
3030
!WARNING: Target of CONTIGUOUS pointer association is not known to be contiguous

flang/test/Semantics/contiguous01.f90

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
! RUN: %python %S/test_errors.py %s %flang_fc1
1+
! RUN: %python %S/test_errors.py %s %flang_fc1 -pedantic
22
module m0
33
real, pointer, contiguous :: p1(:) ! ok
44
real, pointer :: p2(:)
@@ -9,26 +9,26 @@ module m
99
contiguous p1
1010
!ERROR: Cannot change CONTIGUOUS attribute on use-associated 'p2'
1111
contiguous p2
12-
!ERROR: CONTIGUOUS entity 'x' must be an array pointer, assumed-shape, or assumed-rank
12+
!PORTABILITY: CONTIGUOUS entity 'x' should be an array pointer, assumed-shape, or assumed-rank
1313
real, contiguous :: x
14-
!ERROR: CONTIGUOUS entity 'scalar' must be an array pointer, assumed-shape, or assumed-rank
14+
!PORTABILITY: CONTIGUOUS entity 'scalar' should be an array pointer, assumed-shape, or assumed-rank
1515
real, contiguous, pointer :: scalar
16-
!ERROR: CONTIGUOUS entity 'allocatable' must be an array pointer, assumed-shape, or assumed-rank
16+
!PORTABILITY: CONTIGUOUS entity 'allocatable' should be an array pointer, assumed-shape, or assumed-rank
1717
real, contiguous, allocatable :: allocatable
1818
contains
19-
!ERROR: CONTIGUOUS entity 'func' must be an array pointer, assumed-shape, or assumed-rank
19+
!PORTABILITY: CONTIGUOUS entity 'func' should be an array pointer, assumed-shape, or assumed-rank
2020
function func(ashape,arank) result(r)
2121
real, contiguous :: ashape(:) ! ok
2222
real, contiguous :: arank(..) ! ok
23-
!ERROR: CONTIGUOUS entity 'r' must be an array pointer, assumed-shape, or assumed-rank
23+
!PORTABILITY: CONTIGUOUS entity 'r' should be an array pointer, assumed-shape, or assumed-rank
2424
real :: r(10)
25-
!ERROR: CONTIGUOUS entity 'r2' must be an array pointer, assumed-shape, or assumed-rank
25+
!PORTABILITY: CONTIGUOUS entity 'r2' should be an array pointer, assumed-shape, or assumed-rank
2626
real :: r2(10)
2727
contiguous func
2828
contiguous r
2929
contiguous e
3030
contiguous r2
31-
!ERROR: CONTIGUOUS entity 'e' must be an array pointer, assumed-shape, or assumed-rank
31+
!PORTABILITY: CONTIGUOUS entity 'e' should be an array pointer, assumed-shape, or assumed-rank
3232
entry e() result(r2)
3333
end
3434
function fp()

flang/test/Semantics/resolve90.f90

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
! RUN: %python %S/test_errors.py %s %flang_fc1
1+
! RUN: %python %S/test_errors.py %s %flang_fc1 -pedantic
22
! Testing for pointer constant, along with :
33
! C751 A component shall not have both the ALLOCATABLE and POINTER attributes.
44
! C752 If the CONTIGUOUS attribute is specified, the component shall be an
@@ -12,7 +12,7 @@ subroutine s()
1212
!ERROR: 'pointerallocatablefield' may not have both the POINTER and ALLOCATABLE attributes
1313
real, pointer, allocatable :: pointerAllocatableField
1414
real, dimension(:), contiguous, pointer :: goodContigField
15-
!ERROR: CONTIGUOUS component 'badcontigfield' must be an array with the POINTER attribute
15+
!PORTABILITY: CONTIGUOUS component 'badcontigfield' should be an array with the POINTER attribute
1616
real, dimension(:), contiguous, allocatable :: badContigField
1717
character :: charField * 3
1818
!ERROR: A length specifier cannot be used to declare the non-character entity 'realfield'

libcxx/utils/data/ignore_format.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6257,7 +6257,6 @@ libcxx/test/std/utilities/expected/expected.expected/observers/deref.pass.cpp
62576257
libcxx/test/std/utilities/expected/expected.expected/observers/error.pass.cpp
62586258
libcxx/test/std/utilities/expected/expected.expected/observers/has_value.pass.cpp
62596259
libcxx/test/std/utilities/expected/expected.expected/observers/value.pass.cpp
6260-
libcxx/test/std/utilities/expected/expected.expected/swap/member.swap.pass.cpp
62616260
libcxx/test/std/utilities/expected/expected.unexpected/ctad.compile.pass.cpp
62626261
libcxx/test/std/utilities/expected/expected.unexpected/ctor/ctor.inplace.pass.cpp
62636262
libcxx/test/std/utilities/expected/expected.unexpected/ctor/ctor.move.pass.cpp
@@ -6277,7 +6276,6 @@ libcxx/test/std/utilities/expected/expected.void/observers/deref.pass.cpp
62776276
libcxx/test/std/utilities/expected/expected.void/observers/error.pass.cpp
62786277
libcxx/test/std/utilities/expected/expected.void/observers/has_value.pass.cpp
62796278
libcxx/test/std/utilities/expected/expected.void/swap/free.swap.pass.cpp
6280-
libcxx/test/std/utilities/expected/expected.void/swap/member.swap.pass.cpp
62816279
libcxx/test/std/utilities/format/format.arguments/format.args/get.pass.cpp
62826280
libcxx/test/std/utilities/format/format.arguments/format.args/types.compile.pass.cpp
62836281
libcxx/test/std/utilities/format/format.arguments/format.arg/visit_format_arg.pass.cpp

0 commit comments

Comments
 (0)