[compiler-rt] Test fixups for MSVC. (PR #109887)
via llvm-commits
llvm-commits at lists.llvm.org
Tue Sep 24 17:38:46 PDT 2024
github-actions[bot] wrote:
<!--LLVM CODE FORMAT COMMENT: {clang-format}-->
:warning: C/C++ code formatter, clang-format found issues in your code. :warning:
<details>
<summary>
You can test this locally with the following command:
</summary>
``````````bash
git-clang-format --diff 4c4fb6ada7a168e5129a22efb4d604bb6fc60b17 6e404e3e967ee1c896637fd8f6bc03392cb1ea3d --extensions h,cpp,c -- compiler-rt/test/asan/TestCases/defines.h compiler-rt/test/asan/TestCases/Windows/coverage-basic.cpp compiler-rt/test/asan/TestCases/Windows/crash_read_write.cpp compiler-rt/test/asan/TestCases/Windows/dll_host.cpp compiler-rt/test/asan/TestCases/Windows/dll_intercept_memcpy.cpp compiler-rt/test/asan/TestCases/Windows/dll_intercept_memset.cpp compiler-rt/test/asan/TestCases/Windows/dll_null_deref.cpp compiler-rt/test/asan/TestCases/Windows/dll_operator_array_new_with_dtor_left_oob.cpp compiler-rt/test/asan/TestCases/Windows/dll_stack_use_after_return.cpp compiler-rt/test/asan/TestCases/Windows/global_const_string_oob.cpp compiler-rt/test/asan/TestCases/Windows/illegal_instruction.cpp compiler-rt/test/asan/TestCases/Windows/issue64990.cpp compiler-rt/test/asan/TestCases/Windows/msvc/seh.cpp compiler-rt/test/asan/TestCases/Windows/null_deref_multiple_dlls.cpp compiler-rt/test/asan/TestCases/Windows/operator_array_new_with_dtor_left_oob.cpp compiler-rt/test/asan/TestCases/Windows/sse_misalignment.cpp compiler-rt/test/asan/TestCases/Windows/stack_use_after_return.cpp compiler-rt/test/asan/TestCases/Windows/unsymbolized.cpp compiler-rt/test/asan/TestCases/alloca_big_alignment.cpp compiler-rt/test/asan/TestCases/alloca_constant_size.cpp compiler-rt/test/asan/TestCases/alloca_detect_custom_size_.cpp compiler-rt/test/asan/TestCases/alloca_instruments_all_paddings.cpp compiler-rt/test/asan/TestCases/alloca_loop_unpoisoning.cpp compiler-rt/test/asan/TestCases/alloca_overflow_partial.cpp compiler-rt/test/asan/TestCases/alloca_overflow_right.cpp compiler-rt/test/asan/TestCases/alloca_safe_access.cpp compiler-rt/test/asan/TestCases/alloca_underflow_left.cpp compiler-rt/test/asan/TestCases/alloca_vla_interact.cpp compiler-rt/test/asan/TestCases/contiguous_container.cpp compiler-rt/test/asan/TestCases/coverage-trace-pc.cpp compiler-rt/test/asan/TestCases/debug_locate.cpp compiler-rt/test/asan/TestCases/debug_stacks.cpp compiler-rt/test/asan/TestCases/deep_tail_call.cpp compiler-rt/test/asan/TestCases/default_ignorelist.cpp compiler-rt/test/asan/TestCases/default_options.cpp compiler-rt/test/asan/TestCases/error_report_callback.cpp compiler-rt/test/asan/TestCases/exitcode.cpp compiler-rt/test/asan/TestCases/force_inline_opt0.cpp compiler-rt/test/asan/TestCases/global-location-nodebug.cpp compiler-rt/test/asan/TestCases/global-underflow.cpp compiler-rt/test/asan/TestCases/halt_on_error-1.c compiler-rt/test/asan/TestCases/heavy_uar_test.cpp compiler-rt/test/asan/TestCases/ignorelist.cpp compiler-rt/test/asan/TestCases/ill.cpp compiler-rt/test/asan/TestCases/initialization-bug.cpp compiler-rt/test/asan/TestCases/inline.cpp compiler-rt/test/asan/TestCases/intercept-rethrow-exception.cpp compiler-rt/test/asan/TestCases/interception_failure_test.cpp compiler-rt/test/asan/TestCases/interface_test.cpp compiler-rt/test/asan/TestCases/invalid-pointer-pairs-compare-errors.cpp compiler-rt/test/asan/TestCases/invalid-pointer-pairs-subtract-errors.cpp compiler-rt/test/asan/TestCases/invalid-pointer-pairs.cpp compiler-rt/test/asan/TestCases/large_func_test.cpp compiler-rt/test/asan/TestCases/null_deref.cpp compiler-rt/test/asan/TestCases/pass-struct-byval.cpp compiler-rt/test/asan/TestCases/report_error_summary.cpp compiler-rt/test/asan/TestCases/speculative_load.cpp compiler-rt/test/asan/TestCases/stack-buffer-overflow-with-position.cpp compiler-rt/test/asan/TestCases/stack-oob-frames.cpp compiler-rt/test/asan/TestCases/strcat-overlap.cpp compiler-rt/test/asan/TestCases/strcpy-overlap.cpp compiler-rt/test/asan/TestCases/strncat-overlap.cpp compiler-rt/test/asan/TestCases/strncpy-overflow.cpp compiler-rt/test/asan/TestCases/strncpy-overlap.cpp compiler-rt/test/asan/TestCases/throw_call_test.cpp compiler-rt/test/asan/TestCases/throw_catch.cpp compiler-rt/test/asan/TestCases/throw_invoke_test.cpp compiler-rt/test/asan/TestCases/use-after-scope-capture.cpp compiler-rt/test/asan/TestCases/use-after-scope-dtor-order.cpp compiler-rt/test/asan/TestCases/use-after-scope-inlined.cpp compiler-rt/test/asan/TestCases/use-after-scope-loop-bug.cpp compiler-rt/test/asan/TestCases/use-after-scope-loop-removed.cpp compiler-rt/test/asan/TestCases/use-after-scope-loop.cpp compiler-rt/test/asan/TestCases/use-after-scope-temp.cpp compiler-rt/test/asan/TestCases/use-after-scope-temp2.cpp compiler-rt/test/asan/TestCases/use-after-scope-types.cpp compiler-rt/test/asan/TestCases/vla_chrome_testcase.cpp compiler-rt/test/asan/TestCases/vla_condition_overflow.cpp compiler-rt/test/asan/TestCases/vla_loop_overfow.cpp compiler-rt/test/asan/TestCases/zero_page_pc.cpp
``````````
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/compiler-rt/test/asan/TestCases/Windows/crash_read_write.cpp b/compiler-rt/test/asan/TestCases/Windows/crash_read_write.cpp
index 2567faea9f..bafc40c2c5 100644
--- a/compiler-rt/test/asan/TestCases/Windows/crash_read_write.cpp
+++ b/compiler-rt/test/asan/TestCases/Windows/crash_read_write.cpp
@@ -3,8 +3,8 @@
// RUN: not %run %t write 2>&1 | FileCheck %s --check-prefix=WRITE
#include "../defines.h"
-#include <windows.h>
#include <stdio.h>
+#include <windows.h>
static volatile int sink;
ATTRIBUTE_NOINLINE void Read(int *ptr) { sink = *ptr; }
diff --git a/compiler-rt/test/asan/TestCases/Windows/dll_intercept_memcpy.cpp b/compiler-rt/test/asan/TestCases/Windows/dll_intercept_memcpy.cpp
index 55f8a895e4..4fa437960f 100644
--- a/compiler-rt/test/asan/TestCases/Windows/dll_intercept_memcpy.cpp
+++ b/compiler-rt/test/asan/TestCases/Windows/dll_intercept_memcpy.cpp
@@ -23,12 +23,12 @@ int test_function() {
// CHECK: Initial test OK
memcpy(buff2, buff1, 6);
-// CHECK: AddressSanitizer: stack-buffer-overflow on address [[ADDR:0x[0-9a-f]+]]
-// CHECK: WRITE of size 6 at [[ADDR]] thread T0
-// CHECK-NEXT: __asan_{{.*}}{{(memcpy|memmove)}}
-// CHECK-NEXT: test_function {{.*}}dll_intercept_memcpy.cpp:[[@LINE-4]]
-// CHECK: Address [[ADDR]] is located in stack of thread T0 at offset {{.*}} in frame
-// CHECK-NEXT: test_function {{.*}}dll_intercept_memcpy.cpp
-// CHECK: 'buff2'{{.*}} <== Memory access at offset {{.*}} overflows this variable
+ // CHECK: AddressSanitizer: stack-buffer-overflow on address [[ADDR:0x[0-9a-f]+]]
+ // CHECK: WRITE of size 6 at [[ADDR]] thread T0
+ // CHECK-NEXT: __asan_{{.*}}{{(memcpy|memmove)}}
+ // CHECK-NEXT: test_function {{.*}}dll_intercept_memcpy.cpp:[[@LINE-4]]
+ // CHECK: Address [[ADDR]] is located in stack of thread T0 at offset {{.*}} in frame
+ // CHECK-NEXT: test_function {{.*}}dll_intercept_memcpy.cpp
+ // CHECK: 'buff2'{{.*}} <== Memory access at offset {{.*}} overflows this variable
return 0;
}
diff --git a/compiler-rt/test/asan/TestCases/Windows/dll_operator_array_new_with_dtor_left_oob.cpp b/compiler-rt/test/asan/TestCases/Windows/dll_operator_array_new_with_dtor_left_oob.cpp
index df580ff103..f49ce4904f 100644
--- a/compiler-rt/test/asan/TestCases/Windows/dll_operator_array_new_with_dtor_left_oob.cpp
+++ b/compiler-rt/test/asan/TestCases/Windows/dll_operator_array_new_with_dtor_left_oob.cpp
@@ -11,9 +11,11 @@ struct C {
int ATTRIBUTE_NOINLINE
#if __clang__ || !defined(_MSC_VER)
-__attribute__((optnone))
+ __attribute__((optnone))
#endif
-hide(int x) { return x; }
+ hide(int x) {
+ return x;
+}
extern "C" __declspec(dllexport)
int test_function() {
diff --git a/compiler-rt/test/asan/TestCases/Windows/issue64990.cpp b/compiler-rt/test/asan/TestCases/Windows/issue64990.cpp
index 5f851decfe..69bb266393 100644
--- a/compiler-rt/test/asan/TestCases/Windows/issue64990.cpp
+++ b/compiler-rt/test/asan/TestCases/Windows/issue64990.cpp
@@ -5,7 +5,7 @@
// UNSUPPORTED: target={{.*-windows-gnu}}
#if _MSC_VER && !defined(__clang__)
-#include <string.h>
+# include <string.h>
#endif
char buff1[6] = "hello";
diff --git a/compiler-rt/test/asan/TestCases/Windows/operator_array_new_with_dtor_left_oob.cpp b/compiler-rt/test/asan/TestCases/Windows/operator_array_new_with_dtor_left_oob.cpp
index 6cf7d1159c..d3e67d872c 100644
--- a/compiler-rt/test/asan/TestCases/Windows/operator_array_new_with_dtor_left_oob.cpp
+++ b/compiler-rt/test/asan/TestCases/Windows/operator_array_new_with_dtor_left_oob.cpp
@@ -8,7 +8,7 @@ struct C {
~C() {}
};
#if defined(_MSC_VER) && !defined(__clang__)
-#pragma optimize("", off)
+# pragma optimize("", off)
#else
__attribute__((optnone))
#endif
diff --git a/compiler-rt/test/asan/TestCases/Windows/unsymbolized.cpp b/compiler-rt/test/asan/TestCases/Windows/unsymbolized.cpp
index ba8cd16ee8..ade5e5b914 100644
--- a/compiler-rt/test/asan/TestCases/Windows/unsymbolized.cpp
+++ b/compiler-rt/test/asan/TestCases/Windows/unsymbolized.cpp
@@ -9,8 +9,8 @@
// REQUIRES: lld-available
#include "../defines.h"
-#include <stdlib.h>
#include <stdio.h>
+#include <stdlib.h>
int ATTRIBUTE_NOINLINE do_uaf(void);
int main() {
int r = do_uaf();
diff --git a/compiler-rt/test/asan/TestCases/alloca_constant_size.cpp b/compiler-rt/test/asan/TestCases/alloca_constant_size.cpp
index 52e17d4ad1..ce6a767df6 100644
--- a/compiler-rt/test/asan/TestCases/alloca_constant_size.cpp
+++ b/compiler-rt/test/asan/TestCases/alloca_constant_size.cpp
@@ -8,7 +8,7 @@
#include <string.h>
#include <stdlib.h>
#if _MSC_VER
-#include <malloc.h>
+# include <malloc.h>
#endif
// MSVC provides _alloca instead of alloca.
diff --git a/compiler-rt/test/asan/TestCases/alloca_detect_custom_size_.cpp b/compiler-rt/test/asan/TestCases/alloca_detect_custom_size_.cpp
index d6d983dccc..e8e73d46f8 100644
--- a/compiler-rt/test/asan/TestCases/alloca_detect_custom_size_.cpp
+++ b/compiler-rt/test/asan/TestCases/alloca_detect_custom_size_.cpp
@@ -6,7 +6,7 @@
#include <assert.h>
#include <stdint.h>
#if defined(_MSC_VER) && !defined(__clang__)
-#include <malloc.h>
+# include <malloc.h>
#endif
struct A {
@@ -18,7 +18,7 @@ ATTRIBUTE_NOINLINE void foo(int index, int len) {
#if !defined(_MSC_VER) || defined(__clang__)
volatile struct A str[len] ATTRIBUTE_ALIGNED(32);
#else
- volatile struct A *str = (volatile struct A*)_alloca(len * sizeof(struct A));
+ volatile struct A *str = (volatile struct A *)_alloca(len * sizeof(struct A));
#endif
assert(!(reinterpret_cast<uintptr_t>(str) & 31L));
str[index].a[0] = '1'; // BOOM
diff --git a/compiler-rt/test/asan/TestCases/alloca_loop_unpoisoning.cpp b/compiler-rt/test/asan/TestCases/alloca_loop_unpoisoning.cpp
index 8268393477..7cccca1f6a 100644
--- a/compiler-rt/test/asan/TestCases/alloca_loop_unpoisoning.cpp
+++ b/compiler-rt/test/asan/TestCases/alloca_loop_unpoisoning.cpp
@@ -7,10 +7,10 @@
// UNSUPPORTED: MSVC
#include "defines.h"
+#include "sanitizer/asan_interface.h"
#include <assert.h>
#include <stdint.h>
#include <stdlib.h>
-#include "sanitizer/asan_interface.h"
// MSVC provides _alloca instead of alloca.
#if defined(_MSC_VER) && !defined(alloca)
diff --git a/compiler-rt/test/asan/TestCases/coverage-trace-pc.cpp b/compiler-rt/test/asan/TestCases/coverage-trace-pc.cpp
index 906bc0c699..effcc20286 100644
--- a/compiler-rt/test/asan/TestCases/coverage-trace-pc.cpp
+++ b/compiler-rt/test/asan/TestCases/coverage-trace-pc.cpp
@@ -14,9 +14,9 @@ extern "C" void __sanitizer_cov_trace_pc_indir(void *callee) {
last_callee = callee;
}
#else
-#include "defines.h"
-#include <stdio.h>
-#include <assert.h>
+# include "defines.h"
+# include <assert.h>
+# include <stdio.h>
extern int pc_count;
extern void *last_callee;
diff --git a/compiler-rt/test/asan/TestCases/deep_tail_call.cpp b/compiler-rt/test/asan/TestCases/deep_tail_call.cpp
index efe8e9ad0b..772fa48bab 100644
--- a/compiler-rt/test/asan/TestCases/deep_tail_call.cpp
+++ b/compiler-rt/test/asan/TestCases/deep_tail_call.cpp
@@ -7,7 +7,7 @@
#include "defines.h"
int global[10];
// CHECK: {{#0.*call4}}
-void ATTRIBUTE_NOINLINE call4(int i) { global[i+10]++; }
+void ATTRIBUTE_NOINLINE call4(int i) { global[i + 10]++; }
// CHECK: {{#1.*call3}}
void ATTRIBUTE_NOINLINE call3(int i) { call4(i); }
// CHECK: {{#2.*call2}}
diff --git a/compiler-rt/test/asan/TestCases/default_options.cpp b/compiler-rt/test/asan/TestCases/default_options.cpp
index 3bbaba904a..33507f3c82 100644
--- a/compiler-rt/test/asan/TestCases/default_options.cpp
+++ b/compiler-rt/test/asan/TestCases/default_options.cpp
@@ -8,8 +8,7 @@ const char *kAsanDefaultOptions = "verbosity=1 help=1";
#if (__APPLE__)
__attribute__((weak))
#endif
-ATTRIBUTE_NO_SANITIZE_ADDRESS
-extern "C" const char *
+ATTRIBUTE_NO_SANITIZE_ADDRESS extern "C" const char *
__asan_default_options() {
// CHECK: Available flags for AddressSanitizer:
return kAsanDefaultOptions;
diff --git a/compiler-rt/test/asan/TestCases/defines.h b/compiler-rt/test/asan/TestCases/defines.h
index a363589172..34707f58c0 100644
--- a/compiler-rt/test/asan/TestCases/defines.h
+++ b/compiler-rt/test/asan/TestCases/defines.h
@@ -1,32 +1,31 @@
#pragma once
#if defined(_MSC_VER) && !defined(__clang__)
-#include <intrin.h>
+# include <intrin.h>
-#define ATTRIBUTE_NOINLINE __declspec(noinline)
-#define ATTRIBUTE_ALIGNED(x) __declspec(align(x))
-#define ATTRIBUTE_NO_SANITIZE_ADDRESS __declspec(no_sanitize_address)
-#define ATTRIBUTE_USED /* FIXME: Is there a __declspec used? */
-#define ATTRIBUTE_ALWAYS_INLINE __forceinline
-#define VOLATILE volatile
-#define EXTRACT_RETURN_ADDRESS _ReturnAddress()
-#define ASM_CAUSE_SIDE_EFFECT(dest) __asm { mov eax, dest}
-#define MULTIPLE_ATTRIBUTE_DECL(a, b) __declspec(a b)
+# define ATTRIBUTE_NOINLINE __declspec(noinline)
+# define ATTRIBUTE_ALIGNED(x) __declspec(align(x))
+# define ATTRIBUTE_NO_SANITIZE_ADDRESS __declspec(no_sanitize_address)
+# define ATTRIBUTE_USED /* FIXME: Is there a __declspec used? */
+# define ATTRIBUTE_ALWAYS_INLINE __forceinline
+# define VOLATILE volatile
+# define EXTRACT_RETURN_ADDRESS _ReturnAddress()
+# define ASM_CAUSE_SIDE_EFFECT(dest) __asm { mov eax, dest}
+# define MULTIPLE_ATTRIBUTE_DECL(a, b) __declspec(a b)
#else
-#define ATTRIBUTE_NOINLINE __attribute__((noinline))
-#define ATTRIBUTE_ALIGNED(x) __attribute__((aligned(x)))
-#define ATTRIBUTE_NO_SANITIZE_ADDRESS __attribute__((no_sanitize_address))
-#define ATTRIBUTE_USED __attribute__((used))
-#define ATTRIBUTE_ALWAYS_INLINE __attribute__((always_inline))
-#define INLINE_ASM(x) __asm__(x)
-#define VOLATILE __volatile__
-#define EXTRACT_RETURN_ADDRESS __builtin_extract_return_addr(__builtin_return_address(0))
-#define ASM_CAUSE_SIDE_EFFECT(dest) __asm__ __volatile__("" \
- : \
- : "r"(dest) \
- : "memory");
-#define MULTIPLE_ATTRIBUTE_DECL(a, b) __attribute__((a, b))
+# define ATTRIBUTE_NOINLINE __attribute__((noinline))
+# define ATTRIBUTE_ALIGNED(x) __attribute__((aligned(x)))
+# define ATTRIBUTE_NO_SANITIZE_ADDRESS __attribute__((no_sanitize_address))
+# define ATTRIBUTE_USED __attribute__((used))
+# define ATTRIBUTE_ALWAYS_INLINE __attribute__((always_inline))
+# define INLINE_ASM(x) __asm__(x)
+# define VOLATILE __volatile__
+# define EXTRACT_RETURN_ADDRESS \
+ __builtin_extract_return_addr(__builtin_return_address(0))
+# define ASM_CAUSE_SIDE_EFFECT(dest) \
+ __asm__ __volatile__("" : : "r"(dest) : "memory");
+# define MULTIPLE_ATTRIBUTE_DECL(a, b) __attribute__((a, b))
#endif // _MSC_VER
diff --git a/compiler-rt/test/asan/TestCases/error_report_callback.cpp b/compiler-rt/test/asan/TestCases/error_report_callback.cpp
index 7a326f552e..903947e729 100644
--- a/compiler-rt/test/asan/TestCases/error_report_callback.cpp
+++ b/compiler-rt/test/asan/TestCases/error_report_callback.cpp
@@ -12,9 +12,7 @@ static void ErrorReportCallbackOneToZ(const char *report) {
int main(int argc, char **argv) {
__asan_set_error_report_callback(ErrorReportCallbackOneToZ);
- __asan_report_error(
- (void *)EXTRACT_RETURN_ADDRESS, 0, 0,
- 0, true, 1);
+ __asan_report_error((void *)EXTRACT_RETURN_ADDRESS, 0, 0, 0, true, 1);
// CHECK: ABCDEF
// CHECK: ERROR: AddressSanitizer
// CHECK: GHIJKL
diff --git a/compiler-rt/test/asan/TestCases/heavy_uar_test.cpp b/compiler-rt/test/asan/TestCases/heavy_uar_test.cpp
index 59f39dfeae..200d19cdba 100644
--- a/compiler-rt/test/asan/TestCases/heavy_uar_test.cpp
+++ b/compiler-rt/test/asan/TestCases/heavy_uar_test.cpp
@@ -17,8 +17,8 @@
#include "defines.h"
#include <stdio.h>
-#include <string.h>
#include <stdlib.h>
+#include <string.h>
#ifdef _WIN32
# include <windows.h>
#endif
@@ -36,9 +36,8 @@ char *LeakStack() {
return pretend_to_do_something(x);
}
-template<size_t kFrameSize>
-ATTRIBUTE_NOINLINE
-void RecursiveFunctionWithStackFrame(int depth) {
+template <size_t kFrameSize>
+ATTRIBUTE_NOINLINE void RecursiveFunctionWithStackFrame(int depth) {
if (depth <= 0) return;
char x[kFrameSize];
x[0] = depth;
diff --git a/compiler-rt/test/asan/TestCases/ill.cpp b/compiler-rt/test/asan/TestCases/ill.cpp
index 34d6e21322..91f45d424b 100644
--- a/compiler-rt/test/asan/TestCases/ill.cpp
+++ b/compiler-rt/test/asan/TestCases/ill.cpp
@@ -9,7 +9,7 @@
#endif
#if _MSC_VER && !defined(__clang__)
-#define __builtin_trap() __asm ud2;
+# define __builtin_trap() __asm ud2;
#endif
int main(int argc, char **argv) {
diff --git a/compiler-rt/test/asan/TestCases/interception_failure_test.cpp b/compiler-rt/test/asan/TestCases/interception_failure_test.cpp
index 270da1e64d..f567e5c4d3 100644
--- a/compiler-rt/test/asan/TestCases/interception_failure_test.cpp
+++ b/compiler-rt/test/asan/TestCases/interception_failure_test.cpp
@@ -19,7 +19,7 @@
// XFAIL: target={{.*netbsd.*}} && !asan-dynamic-runtime
#if _MSC_VER && !defined(__clang__)
-#pragma warning(disable : 4273)
+# pragma warning(disable : 4273)
#endif
#include <stdlib.h>
diff --git a/compiler-rt/test/asan/TestCases/strncpy-overflow.cpp b/compiler-rt/test/asan/TestCases/strncpy-overflow.cpp
index 50147d1647..f75f8c5eb3 100644
--- a/compiler-rt/test/asan/TestCases/strncpy-overflow.cpp
+++ b/compiler-rt/test/asan/TestCases/strncpy-overflow.cpp
@@ -7,8 +7,8 @@
// REQUIRES: stable-runtime
#include "defines.h"
-#include <string.h>
#include <stdlib.h>
+#include <string.h>
// We need a way to prevent the optimize from eliminating the
// strncpy below (which otherwises writes to dead storage). We
diff --git a/compiler-rt/test/asan/TestCases/throw_catch.cpp b/compiler-rt/test/asan/TestCases/throw_catch.cpp
index 294fc61cfa..71e66e3fc4 100644
--- a/compiler-rt/test/asan/TestCases/throw_catch.cpp
+++ b/compiler-rt/test/asan/TestCases/throw_catch.cpp
@@ -2,8 +2,8 @@
#include "defines.h"
#include <assert.h>
-#include <stdio.h>
#include <sanitizer/asan_interface.h>
+#include <stdio.h>
ATTRIBUTE_NOINLINE
void Throw() {
diff --git a/compiler-rt/test/asan/TestCases/use-after-scope-temp.cpp b/compiler-rt/test/asan/TestCases/use-after-scope-temp.cpp
index ea93c5d1fc..ab14e14e48 100644
--- a/compiler-rt/test/asan/TestCases/use-after-scope-temp.cpp
+++ b/compiler-rt/test/asan/TestCases/use-after-scope-temp.cpp
@@ -8,9 +8,7 @@ struct IntHolder {
const IntHolder *saved;
-ATTRIBUTE_NOINLINE void save(const IntHolder &holder) {
- saved = &holder;
-}
+ATTRIBUTE_NOINLINE void save(const IntHolder &holder) { saved = &holder; }
int main(int argc, char *argv[]) {
save({argc});
diff --git a/compiler-rt/test/asan/TestCases/use-after-scope-temp2.cpp b/compiler-rt/test/asan/TestCases/use-after-scope-temp2.cpp
index ef4b6e5100..ff65f592ee 100644
--- a/compiler-rt/test/asan/TestCases/use-after-scope-temp2.cpp
+++ b/compiler-rt/test/asan/TestCases/use-after-scope-temp2.cpp
@@ -4,9 +4,7 @@
#include "defines.h"
struct IntHolder {
- ATTRIBUTE_NOINLINE const IntHolder &Self() const {
- return *this;
- }
+ ATTRIBUTE_NOINLINE const IntHolder &Self() const { return *this; }
int val = 3;
};
diff --git a/compiler-rt/test/asan/TestCases/vla_chrome_testcase.cpp b/compiler-rt/test/asan/TestCases/vla_chrome_testcase.cpp
index 8688a374a4..9b50a151ef 100644
--- a/compiler-rt/test/asan/TestCases/vla_chrome_testcase.cpp
+++ b/compiler-rt/test/asan/TestCases/vla_chrome_testcase.cpp
@@ -7,16 +7,15 @@
// See http://reviews.llvm.org/D6055?vs=on&id=15616&whitespace=ignore-all#toc.
#include "defines.h"
-#include <stdint.h>
#include <assert.h>
+#include <stdint.h>
int a = 7;
int b;
int c;
int *p;
-ATTRIBUTE_NOINLINE void fn3(int *first, int second) {
-}
+ATTRIBUTE_NOINLINE void fn3(int *first, int second) {}
int main() {
int d = b && c;
diff --git a/compiler-rt/test/asan/TestCases/zero_page_pc.cpp b/compiler-rt/test/asan/TestCases/zero_page_pc.cpp
index 720a74499c..2814a6b1e0 100644
--- a/compiler-rt/test/asan/TestCases/zero_page_pc.cpp
+++ b/compiler-rt/test/asan/TestCases/zero_page_pc.cpp
@@ -2,7 +2,7 @@
// RUN: %clangxx_asan %s -o %t && not %run %t 2>&1 | FileCheck %s
#if _MSC_VER && !defined(__CLANG__)
-#define __has_feature(x) 0
+# define __has_feature(x) 0
#endif
#if __has_feature(ptrauth_calls)
``````````
</details>
https://github.com/llvm/llvm-project/pull/109887
More information about the llvm-commits
mailing list