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
acc770ae
Commit
acc770ae
authored
Oct 28, 2014
by
Maxim Ostapenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add missing tests.
From-SVN: r216785
parent
bdea98ca
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
120 additions
and
0 deletions
+120
-0
gcc/testsuite/c-c++-common/asan/no-redundant-instrumentation-10.c
+18
-0
gcc/testsuite/c-c++-common/asan/no-redundant-instrumentation-11.c
+20
-0
gcc/testsuite/c-c++-common/asan/no-redundant-instrumentation-12.c
+16
-0
gcc/testsuite/c-c++-common/asan/no-redundant-instrumentation-13.c
+15
-0
gcc/testsuite/c-c++-common/asan/no-redundant-instrumentation-14.c
+15
-0
gcc/testsuite/c-c++-common/asan/no-redundant-instrumentation-15.c
+16
-0
gcc/testsuite/c-c++-common/asan/pr63638.c
+20
-0
No files found.
gcc/testsuite/c-c++-common/asan/no-redundant-instrumentation-10.c
0 → 100644
View file @
acc770ae
/* { dg-options "-fdump-tree-sanopt" } */
/* { dg-do compile } */
/* { dg-skip-if "" { *-*-* } { "*" } { "-O0" } } */
extern
__UINT32_TYPE__
a
;
void
foo
()
{
/* Instrument a with access size 3. */
int
d
=
__builtin_memcmp
(
&
a
,
"123"
,
3
);
/* This should generate a __builtin___asan_report_store4, because
the reference to a has been instrumented above with access size 3. */
a
=
1
;
}
/* { dg-final { scan-tree-dump-times "__builtin___asan_report_store4" 1 "sanopt" } } */
/* { dg-final { cleanup-tree-dump "sanopt" } } */
gcc/testsuite/c-c++-common/asan/no-redundant-instrumentation-11.c
0 → 100644
View file @
acc770ae
/* { dg-options "-fdump-tree-sanopt" } */
/* { dg-do compile } */
/* { dg-skip-if "" { *-*-* } { "*" } { "-O0" } } */
extern
__UINT32_TYPE__
a
;
void
foo
()
{
/* Instrument a with access size 5. */
int
d
=
__builtin_memcmp
(
&
a
,
"12345"
,
4
);
/* This should not generate a __builtin___asan_report_store4 because
the reference to a has been already instrumented above with access
size 5. */
a
=
1
;
}
/* { dg-final { scan-tree-dump-not "& 7" "sanopt" } } */
/* { dg-final { scan-tree-dump-not "__builtin___asan_report_store" "sanopt" } } */
/* { dg-final { cleanup-tree-dump "sanopt" } } */
gcc/testsuite/c-c++-common/asan/no-redundant-instrumentation-12.c
0 → 100644
View file @
acc770ae
/* { dg-options "-fdump-tree-sanopt" } */
/* { dg-do compile } */
/* { dg-skip-if "" { *-*-* } { "-flto" } { "" } } */
void
foo
(
char
*
p
)
{
volatile
int
zero
=
0
;
__builtin_memcpy
(
p
,
"abc"
,
zero
);
/* This generates a __builtin___asan_report_store1 because we pass volatile
zero length into memcpy. */
p
[
0
]
=
'd'
;
}
/* { dg-final { scan-tree-dump-times "__builtin___asan_report_store1" 1 "sanopt" } } */
/* { dg-final { cleanup-tree-dump "sanopt" } } */
gcc/testsuite/c-c++-common/asan/no-redundant-instrumentation-13.c
0 → 100644
View file @
acc770ae
/* { dg-options "-fdump-tree-sanopt" } */
/* { dg-do compile } */
/* { dg-skip-if "" { *-*-* } { "*" } { "-O0" } } */
void
foo
(
char
*
p
)
{
__builtin_memcpy
(
p
,
"abc"
,
0
);
/* This generates a __builtin___asan_report_store1 because we didn't access
any byte in previous memcpy because of zero length parameter. */
p
[
0
]
=
'd'
;
}
/* { dg-final { scan-tree-dump-times "__builtin___asan_report_store1" 1 "sanopt" } } */
/* { dg-final { cleanup-tree-dump "sanopt" } } */
gcc/testsuite/c-c++-common/asan/no-redundant-instrumentation-14.c
0 → 100644
View file @
acc770ae
/* { dg-options "-fdump-tree-sanopt" } */
/* { dg-do compile } */
/* { dg-skip-if "" { *-*-* } { "*" } { "-O0" } } */
void
foo
(
char
*
p
)
{
__builtin_memcpy
(
p
,
"abc"
,
2
);
/* This doesn't generate a __builtin___asan_report_store1 because we
verified p[0] through p[2] is writable in previous memcpy call. */
p
[
0
]
=
'd'
;
}
/* { dg-final { scan-tree-dump-not "__builtin___asan_report_store1" "sanopt" } } */
/* { dg-final { cleanup-tree-dump "sanopt" } } */
gcc/testsuite/c-c++-common/asan/no-redundant-instrumentation-15.c
0 → 100644
View file @
acc770ae
/* { dg-options "-fdump-tree-sanopt" } */
/* { dg-do compile } */
/* { dg-skip-if "" { *-*-* } { "-flto" } { "" } } */
void
foo
(
char
*
p
)
{
volatile
int
two
=
2
;
__builtin_memcpy
(
p
,
"abc"
,
two
);
/* This generates a __builtin___asan_report_store1 because we don't
optimize previous memcpy call. */
p
[
0
]
=
'd'
;
}
/* { dg-final { scan-tree-dump-times "__builtin___asan_report_store1" 1 "sanopt" } } */
/* { dg-final { cleanup-tree-dump "sanopt" } } */
gcc/testsuite/c-c++-common/asan/pr63638.c
0 → 100644
View file @
acc770ae
/* { dg-do compile } */
extern
#ifdef __cplusplus
"C"
#endif
void
*
memcpy
(
void
*
,
const
void
*
,
__SIZE_TYPE__
);
struct
S
{
long
d0
,
d1
,
d2
,
d3
,
d4
,
d5
,
d6
;
};
struct
S
s
[
6
];
int
f
(
struct
S
*
p
)
{
memcpy
(
p
,
&
s
[
2
],
sizeof
(
*
p
));
memcpy
(
p
,
&
s
[
1
],
sizeof
(
*
p
));
}
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