diff --git a/compiler-rt/test/hwasan/TestCases/use-after-scope-capture.cpp b/compiler-rt/test/hwasan/TestCases/use-after-scope-capture.cpp --- a/compiler-rt/test/hwasan/TestCases/use-after-scope-capture.cpp +++ b/compiler-rt/test/hwasan/TestCases/use-after-scope-capture.cpp @@ -11,10 +11,10 @@ { int x = 0; f = [&x]() __attribute__((noinline)) { - return x; // BOOM + return x; // BOOM // CHECK: ERROR: AddressSanitizer: stack-use-after-scope // CHECK: #0 0x{{.*}} in {{.*}}use-after-scope-capture.cpp:[[@LINE-2]] }; } - return f(); // BOOM + return f(); // BOOM } diff --git a/compiler-rt/test/hwasan/TestCases/use-after-scope-dtor-order.cpp b/compiler-rt/test/hwasan/TestCases/use-after-scope-dtor-order.cpp --- a/compiler-rt/test/hwasan/TestCases/use-after-scope-dtor-order.cpp +++ b/compiler-rt/test/hwasan/TestCases/use-after-scope-dtor-order.cpp @@ -7,9 +7,9 @@ #include struct IntHolder { - explicit IntHolder(int *val = 0) : val_(val) { } + explicit IntHolder(int *val = 0) : val_(val) {} __attribute__((noinline)) ~IntHolder() { - printf("Value: %d\n", *val_); // BOOM + printf("Value: %d\n", *val_); // BOOM // CHECK: ERROR: AddressSanitizer: stack-use-after-scope // CHECK: #0 0x{{.*}} in IntHolder::~IntHolder{{.*}}.cpp:[[@LINE-2]] } diff --git a/compiler-rt/test/hwasan/TestCases/use-after-scope-goto.cpp b/compiler-rt/test/hwasan/TestCases/use-after-scope-goto.cpp --- a/compiler-rt/test/hwasan/TestCases/use-after-scope-goto.cpp +++ b/compiler-rt/test/hwasan/TestCases/use-after-scope-goto.cpp @@ -15,7 +15,7 @@ goto label; int tmp; - label: +label: ptr = &tmp; *ptr = 5; } @@ -45,7 +45,7 @@ exit(0); } - l2: +l2: goto l1; } @@ -59,11 +59,11 @@ void f4() { { int x; - l2: + l2: use(&x); goto l1; } - l1: +l1: goto l2; } diff --git a/compiler-rt/test/hwasan/TestCases/use-after-scope-if.cpp b/compiler-rt/test/hwasan/TestCases/use-after-scope-if.cpp --- a/compiler-rt/test/hwasan/TestCases/use-after-scope-if.cpp +++ b/compiler-rt/test/hwasan/TestCases/use-after-scope-if.cpp @@ -10,9 +10,9 @@ int main() { if (b) { int x[5]; - p = x+1; + p = x + 1; } - return *p; // BOOM + return *p; // BOOM // CHECK: ERROR: AddressSanitizer: stack-use-after-scope // CHECK: #0 0x{{.*}} in main {{.*}}.cpp:[[@LINE-2]] } diff --git a/compiler-rt/test/hwasan/TestCases/use-after-scope-inlined.cpp b/compiler-rt/test/hwasan/TestCases/use-after-scope-inlined.cpp --- a/compiler-rt/test/hwasan/TestCases/use-after-scope-inlined.cpp +++ b/compiler-rt/test/hwasan/TestCases/use-after-scope-inlined.cpp @@ -10,16 +10,16 @@ int *arr; -__attribute__((always_inline)) -void inlined(int arg) { +__attribute__((always_inline)) void inlined(int arg) { int x[5]; - for (int i = 0; i < arg; i++) x[i] = i; + for (int i = 0; i < arg; i++) + x[i] = i; arr = x; } int main(int argc, char *argv[]) { inlined(argc); - return arr[argc - 1]; // BOOM + return arr[argc - 1]; // BOOM // CHECK: ERROR: AddressSanitizer: stack-use-after-scope // CHECK: READ of size 4 at 0x{{.*}} thread T0 // CHECK: #0 0x{{.*}} in main diff --git a/compiler-rt/test/hwasan/TestCases/use-after-scope-loop-bug.cpp b/compiler-rt/test/hwasan/TestCases/use-after-scope-loop-bug.cpp --- a/compiler-rt/test/hwasan/TestCases/use-after-scope-loop-bug.cpp +++ b/compiler-rt/test/hwasan/TestCases/use-after-scope-loop-bug.cpp @@ -12,7 +12,7 @@ int x[3] = {i, i, i}; p = x + i; } - return *p; // BOOM + return *p; // BOOM // CHECK: ERROR: AddressSanitizer: stack-use-after-scope // CHECK: #0 0x{{.*}} in main {{.*}}use-after-scope-loop-bug.cpp:[[@LINE-2]] // CHECK: Address 0x{{.*}} is located in stack of thread T{{.*}} at offset [[OFFSET:[^ ]+]] in frame diff --git a/compiler-rt/test/hwasan/TestCases/use-after-scope-loop-removed.cpp b/compiler-rt/test/hwasan/TestCases/use-after-scope-loop-removed.cpp --- a/compiler-rt/test/hwasan/TestCases/use-after-scope-loop-removed.cpp +++ b/compiler-rt/test/hwasan/TestCases/use-after-scope-loop-removed.cpp @@ -13,7 +13,7 @@ int x; p = &x; } - return *p; // BOOM + return *p; // BOOM // CHECK: ERROR: AddressSanitizer: stack-use-after-scope // CHECK: #0 0x{{.*}} in main {{.*}}use-after-scope-loop-removed.cpp:[[@LINE-2]] // CHECK: Address 0x{{.*}} is located in stack of thread T{{.*}} at offset [[OFFSET:[^ ]+]] in frame diff --git a/compiler-rt/test/hwasan/TestCases/use-after-scope-loop.cpp b/compiler-rt/test/hwasan/TestCases/use-after-scope-loop.cpp --- a/compiler-rt/test/hwasan/TestCases/use-after-scope-loop.cpp +++ b/compiler-rt/test/hwasan/TestCases/use-after-scope-loop.cpp @@ -11,7 +11,7 @@ int x; p[i] = &x; } - return **p; // BOOM + return **p; // BOOM // CHECK: ERROR: AddressSanitizer: stack-use-after-scope // CHECK: #0 0x{{.*}} in main {{.*}}.cpp:[[@LINE-2]] } diff --git a/compiler-rt/test/hwasan/TestCases/use-after-scope-temp.cpp b/compiler-rt/test/hwasan/TestCases/use-after-scope-temp.cpp --- a/compiler-rt/test/hwasan/TestCases/use-after-scope-temp.cpp +++ b/compiler-rt/test/hwasan/TestCases/use-after-scope-temp.cpp @@ -4,7 +4,6 @@ // Not expected to work yet with HWAsan. // XFAIL: * - struct IntHolder { int val; }; @@ -17,7 +16,7 @@ int main(int argc, char *argv[]) { save({argc}); - int x = saved->val; // BOOM + int x = saved->val; // BOOM // CHECK: ERROR: AddressSanitizer: stack-use-after-scope // CHECK: #0 0x{{.*}} in main {{.*}}use-after-scope-temp.cpp:[[@LINE-2]] return x; diff --git a/compiler-rt/test/hwasan/TestCases/use-after-scope-temp2.cpp b/compiler-rt/test/hwasan/TestCases/use-after-scope-temp2.cpp --- a/compiler-rt/test/hwasan/TestCases/use-after-scope-temp2.cpp +++ b/compiler-rt/test/hwasan/TestCases/use-after-scope-temp2.cpp @@ -4,7 +4,6 @@ // Not expected to work yet with HWAsan. // XFAIL: * - struct IntHolder { __attribute__((noinline)) const IntHolder &Self() const { return *this; @@ -16,7 +15,7 @@ int main(int argc, char *argv[]) { saved = &IntHolder().Self(); - int x = saved->val; // BOOM + int x = saved->val; // BOOM // CHECK: ERROR: AddressSanitizer: stack-use-after-scope // CHECK: #0 0x{{.*}} in main {{.*}}use-after-scope-temp2.cpp:[[@LINE-2]] return x; diff --git a/compiler-rt/test/hwasan/TestCases/use-after-scope-types.cpp b/compiler-rt/test/hwasan/TestCases/use-after-scope-types.cpp --- a/compiler-rt/test/hwasan/TestCases/use-after-scope-types.cpp +++ b/compiler-rt/test/hwasan/TestCases/use-after-scope-types.cpp @@ -18,7 +18,8 @@ #include #include -template struct Ptr { +template +struct Ptr { void Store(T *ptr) { t = ptr; } void Access() { *t = {}; } @@ -26,7 +27,8 @@ T *t; }; -template struct Ptr { +template +struct Ptr { using Type = T[N]; void Store(Type *ptr) { t = *ptr; } @@ -35,7 +37,8 @@ T *t; }; -template __attribute__((noinline)) void test() { +template +__attribute__((noinline)) void test() { Ptr ptr; { T x; @@ -52,17 +55,17 @@ int main(int argc, char **argv) { using Tests = void (*)(); Tests tests[] = { - &test, - &test, - &test, - &test, - &test, - &test, - &test>, - &test, - &test, - &test, - &test, + &test, + &test, + &test, + &test, + &test, + &test, + &test>, + &test, + &test, + &test, + &test, }; int n = atoi(argv[1]); diff --git a/compiler-rt/test/hwasan/TestCases/use-after-scope.cpp b/compiler-rt/test/hwasan/TestCases/use-after-scope.cpp --- a/compiler-rt/test/hwasan/TestCases/use-after-scope.cpp +++ b/compiler-rt/test/hwasan/TestCases/use-after-scope.cpp @@ -15,7 +15,7 @@ int x = 0; p = &x; } - *p = 5; // BOOM + *p = 5; // BOOM // CHECK: ERROR: AddressSanitizer: stack-use-after-scope // CHECK: #0 0x{{.*}} in main {{.*}}use-after-scope.cpp:[[@LINE-2]] // CHECK: Address 0x{{.*}} is located in stack of thread T{{.*}} at offset [[OFFSET:[^ ]+]] in frame