File tree Expand file tree Collapse file tree 1 file changed +12
-18
lines changed
compiler-rt/test/lsan/TestCases Expand file tree Collapse file tree 1 file changed +12
-18
lines changed Original file line number Diff line number Diff line change 5
5
// RUN: %env_lsan_opts=$LSAN_BASE:"use_registers=1" %run %t 2>&1
6
6
// RUN: %env_lsan_opts="" %run %t 2>&1
7
7
8
+ #include " sanitizer_common/print_address.h"
8
9
#include < assert.h>
9
10
#include < pthread.h>
10
11
#include < sched.h>
11
12
#include < stdio.h>
12
13
#include < stdlib.h>
13
- #include " sanitizer_common/print_address.h"
14
14
15
- extern " C"
16
- void *registers_thread_func (void *arg) {
15
+ extern " C" void *registers_thread_func (void *arg) {
17
16
int *sync = reinterpret_cast <int *>(arg);
18
17
void *p = malloc (1337 );
19
18
print_address (" Test alloc: " , 1 , p);
@@ -22,30 +21,25 @@ void *registers_thread_func(void *arg) {
22
21
// To store the pointer, choose a register which is unlikely to be reused by
23
22
// a function call.
24
23
#if defined(__i386__)
25
- asm ( " mov %0, %%esi"
24
+ asm ( " mov %0, %%esi"
26
25
:
27
- : " r" (p)
28
- );
26
+ : " r" (p));
29
27
#elif defined(__x86_64__)
30
- asm ( " mov %0, %%r15"
28
+ asm ( " mov %0, %%r15"
31
29
:
32
- : " r" (p)
33
- );
30
+ : " r" (p));
34
31
#elif defined(__mips__)
35
- asm ( " move $16, %0"
32
+ asm ( " move $16, %0"
36
33
:
37
- : " r" (p)
38
- );
34
+ : " r" (p));
39
35
#elif defined(__arm__)
40
- asm ( " mov r5, %0"
36
+ asm ( " mov r5, %0"
41
37
:
42
- : " r" (p)
43
- );
38
+ : " r" (p));
44
39
#elif defined(__powerpc__)
45
- asm ( " mr 30, %0"
40
+ asm ( " mr 30, %0"
46
41
:
47
- : " r" (p)
48
- );
42
+ : " r" (p));
49
43
#elif defined(__s390x__)
50
44
asm (" lgr %%r10, %0"
51
45
:
You can’t perform that action at this time.
0 commit comments