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
af3978a1
Commit
af3978a1
authored
Jan 31, 2014
by
Max Ostapenko
Committed by
Maxim Ostapenko
Jan 31, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* c-c++-common/tsan/simple_race.c: Made test less flaky.
From-SVN: r207344
parent
e0514839
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
1 deletions
+27
-1
gcc/testsuite/ChangeLog
+3
-0
gcc/testsuite/c-c++-common/tsan/simple_race.c
+24
-1
No files found.
gcc/testsuite/ChangeLog
View file @
af3978a1
2014-01-31 Maxim Ostapenko <m.ostapenko@partner.samsung.com>
* c-c++-common/tsan/simple_race.c: Made test less flaky.
2014-01-31 Ilya Tocar <ilya.tocar@intel.com>
2014-01-31 Ilya Tocar <ilya.tocar@intel.com>
* gcc.target/i386/m512-check.h: Use correct rounding values.
* gcc.target/i386/m512-check.h: Use correct rounding values.
...
...
gcc/testsuite/c-c++-common/tsan/simple_race.c
View file @
af3978a1
/* { dg-do run } */
/* { dg-do run } */
/* { dg-set-target-env-var TSAN_OPTIONS "halt_on_error=1" } */
/* { dg-shouldfail "tsan" } */
/* { dg-shouldfail "tsan" } */
#include <pthread.h>
#include <pthread.h>
#include <stdio.h>
#include <stdio.h>
#include <unistd.h>
#define MAX_ITERATIONS_NUMBER 100
#define SLEEP_STEP 128000
unsigned
int
delay_time
=
1000
;
static
inline
void
delay
()
{
usleep
(
delay_time
);
}
extern
int
main_1
();
int
main
()
{
int
i
;
for
(
i
=
0
;
i
<
MAX_ITERATIONS_NUMBER
;
i
++
)
{
main_1
();
delay_time
+=
delay_time
<
256000
?
delay_time
:
SLEEP_STEP
;
}
return
0
;
}
int
Global
;
int
Global
;
void
*
Thread1
(
void
*
x
)
{
void
*
Thread1
(
void
*
x
)
{
delay
();
Global
=
42
;
Global
=
42
;
return
NULL
;
return
NULL
;
}
}
...
@@ -16,7 +39,7 @@ void *Thread2(void *x) {
...
@@ -16,7 +39,7 @@ void *Thread2(void *x) {
return
NULL
;
return
NULL
;
}
}
int
main
()
{
int
main
_1
()
{
pthread_t
t
[
2
];
pthread_t
t
[
2
];
pthread_create
(
&
t
[
0
],
NULL
,
Thread1
,
NULL
);
pthread_create
(
&
t
[
0
],
NULL
,
Thread1
,
NULL
);
pthread_create
(
&
t
[
1
],
NULL
,
Thread2
,
NULL
);
pthread_create
(
&
t
[
1
],
NULL
,
Thread2
,
NULL
);
...
...
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