[compiler-rt] 343410d - [LSAN][NFC] Reformat test
Vitaly Buka via llvm-commits
llvm-commits at lists.llvm.org
Tue Oct 20 14:17:14 PDT 2020
Author: Vitaly Buka
Date: 2020-10-20T14:16:27-07:00
New Revision: 343410d1cc154db99b7858e0a9c3ffd86ad94e45
URL: https://github.com/llvm/llvm-project/commit/343410d1cc154db99b7858e0a9c3ffd86ad94e45
DIFF: https://github.com/llvm/llvm-project/commit/343410d1cc154db99b7858e0a9c3ffd86ad94e45.diff
LOG: [LSAN][NFC] Reformat test
Added:
Modified:
compiler-rt/test/lsan/TestCases/use_registers.cpp
Removed:
################################################################################
diff --git a/compiler-rt/test/lsan/TestCases/use_registers.cpp b/compiler-rt/test/lsan/TestCases/use_registers.cpp
index 2a7d97e0fb45..60071767456d 100644
--- a/compiler-rt/test/lsan/TestCases/use_registers.cpp
+++ b/compiler-rt/test/lsan/TestCases/use_registers.cpp
@@ -5,15 +5,14 @@
// RUN: %env_lsan_opts=$LSAN_BASE:"use_registers=1" %run %t 2>&1
// RUN: %env_lsan_opts="" %run %t 2>&1
+#include "sanitizer_common/print_address.h"
#include <assert.h>
#include <pthread.h>
#include <sched.h>
#include <stdio.h>
#include <stdlib.h>
-#include "sanitizer_common/print_address.h"
-extern "C"
-void *registers_thread_func(void *arg) {
+extern "C" void *registers_thread_func(void *arg) {
int *sync = reinterpret_cast<int *>(arg);
void *p = malloc(1337);
print_address("Test alloc: ", 1, p);
@@ -22,30 +21,25 @@ void *registers_thread_func(void *arg) {
// To store the pointer, choose a register which is unlikely to be reused by
// a function call.
#if defined(__i386__)
- asm ( "mov %0, %%esi"
+ asm("mov %0, %%esi"
:
- : "r" (p)
- );
+ : "r"(p));
#elif defined(__x86_64__)
- asm ( "mov %0, %%r15"
+ asm("mov %0, %%r15"
:
- : "r" (p)
- );
+ : "r"(p));
#elif defined(__mips__)
- asm ( "move $16, %0"
+ asm("move $16, %0"
:
- : "r" (p)
- );
+ : "r"(p));
#elif defined(__arm__)
- asm ( "mov r5, %0"
+ asm("mov r5, %0"
:
- : "r" (p)
- );
+ : "r"(p));
#elif defined(__powerpc__)
- asm ( "mr 30, %0"
+ asm("mr 30, %0"
:
- : "r" (p)
- );
+ : "r"(p));
#elif defined(__s390x__)
asm("lgr %%r10, %0"
:
More information about the llvm-commits
mailing list