-
Notifications
You must be signed in to change notification settings - Fork 892
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
77 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -138,6 +138,7 @@ struct Obj { | |
|
||
// Global variable | ||
bool is_tentative; | ||
bool is_tls; | ||
char *init_data; | ||
Relocation *rel; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
#include "test.h" | ||
#include <stdio.h> | ||
#include <threads.h> | ||
|
||
thread_local int v1; | ||
thread_local int v2 = 5; | ||
int v3 = 7; | ||
|
||
int thread_main(void *unused) { | ||
ASSERT(0, v1); | ||
ASSERT(5, v2); | ||
ASSERT(7, v3); | ||
|
||
v1 = 1; | ||
v2 = 2; | ||
v3 = 3; | ||
|
||
ASSERT(1, v1); | ||
ASSERT(2, v2); | ||
ASSERT(3, v3); | ||
|
||
return 0; | ||
} | ||
|
||
int main() { | ||
thrd_t thr; | ||
|
||
ASSERT(0, v1); | ||
ASSERT(5, v2); | ||
ASSERT(7, v3); | ||
|
||
ASSERT(thrd_success, thrd_create(&thr, thread_main, NULL)); | ||
ASSERT(thrd_success, thrd_join(thr, NULL)); | ||
|
||
ASSERT(0, v1); | ||
ASSERT(5, v2); | ||
ASSERT(3, v3); | ||
|
||
printf("OK\n"); | ||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters