Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
R
riscv-gcc-1
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lvzhengyang
riscv-gcc-1
Commits
5b17a01c
Commit
5b17a01c
authored
May 20, 2016
by
Prathamesh Kulkarni
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add test-cases mentioned in r236502.
From-SVN: r236503
parent
550fa093
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
87 additions
and
0 deletions
+87
-0
gcc/testsuite/gcc.dg/vect/section-anchors-vect-70.c
+33
-0
gcc/testsuite/gcc.dg/vect/section-anchors-vect-71.c
+25
-0
gcc/testsuite/gcc.dg/vect/section-anchors-vect-72.c
+29
-0
No files found.
gcc/testsuite/gcc.dg/vect/section-anchors-vect-70.c
0 → 100644
View file @
5b17a01c
/* { dg-do compile } */
/* { dg-require-effective-target section_anchors } */
/* { dg-require-effective-target vect_int } */
#define N 32
/* Increase alignment of struct if an array's offset is multiple of alignment of
vector type corresponding to it's scalar type.
For the below test-case:
offsetof(e) == 8 bytes.
i) For arm: let x = alignment of vector type corresponding to int,
x == 8 bytes.
Since offsetof(e) % x == 0, set DECL_ALIGN(a, b, c) to x.
ii) For aarch64, ppc: x == 16 bytes.
Since offsetof(e) % x != 0, don't increase alignment of a, b, c.
*/
static
struct
A
{
int
p1
,
p2
;
int
e
[
N
];
}
a
,
b
,
c
;
int
foo
(
void
)
{
for
(
int
i
=
0
;
i
<
N
;
i
++
)
a
.
e
[
i
]
=
b
.
e
[
i
]
+
c
.
e
[
i
];
return
a
.
e
[
0
];
}
/* { dg-final { scan-ipa-dump-times "Increasing alignment of decl" 0 "increase_alignment" { target aarch64*-*-* } } } */
/* { dg-final { scan-ipa-dump-times "Increasing alignment of decl" 0 "increase_alignment" { target powerpc64*-*-* } } } */
/* { dg-final { scan-ipa-dump-times "Increasing alignment of decl" 3 "increase_alignment" { target arm*-*-* } } } */
gcc/testsuite/gcc.dg/vect/section-anchors-vect-71.c
0 → 100644
View file @
5b17a01c
/* { dg-do compile } */
/* { dg-require-effective-target section_anchors } */
/* { dg-require-effective-target vect_int } */
/* Should not increase alignment of the struct because
sizeof (A.e) < sizeof(corresponding vector type). */
#define N 3
static
struct
A
{
int
p1
,
p2
;
int
e
[
N
];
}
a
,
b
,
c
;
int
foo
(
void
)
{
for
(
int
i
=
0
;
i
<
N
;
i
++
)
a
.
e
[
i
]
=
b
.
e
[
i
]
+
c
.
e
[
i
];
return
a
.
e
[
0
];
}
/* { dg-final { scan-ipa-dump-times "Increasing alignment of decl" 0 "increase_alignment" { target aarch64*-*-* } } } */
/* { dg-final { scan-ipa-dump-times "Increasing alignment of decl" 0 "increase_alignment" { target powerpc64*-*-* } } } */
/* { dg-final { scan-ipa-dump-times "Increasing alignment of decl" 0 "increase_alignment" { target arm*-*-* } } } */
gcc/testsuite/gcc.dg/vect/section-anchors-vect-72.c
0 → 100644
View file @
5b17a01c
/* { dg-do compile } */
/* { dg-require-effective-target section_anchors } */
/* { dg-require-effective-target vect_int } */
#define N 32
/* Clone of section-anchors-vect-70.c having nested struct. */
struct
S
{
int
e
[
N
];
};
static
struct
A
{
int
p1
,
p2
;
struct
S
s
;
}
a
,
b
,
c
;
int
foo
(
void
)
{
for
(
int
i
=
0
;
i
<
N
;
i
++
)
a
.
s
.
e
[
i
]
=
b
.
s
.
e
[
i
]
+
c
.
s
.
e
[
i
];
return
a
.
s
.
e
[
0
];
}
/* { dg-final { scan-ipa-dump-times "Increasing alignment of decl" 0 "increase_alignment" { target aarch64*-*-* } } } */
/* { dg-final { scan-ipa-dump-times "Increasing alignment of decl" 0 "increase_alignment" { target powerpc64*-*-* } } } */
/* { dg-final { scan-ipa-dump-times "Increasing alignment of decl" 3 "increase_alignment" { target arm*-*-* } } } */
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment