diff --git a/compiler-rt/test/hwasan/TestCases/Linux/atfork.cpp b/compiler-rt/test/hwasan/TestCases/Linux/atfork.cpp --- a/compiler-rt/test/hwasan/TestCases/Linux/atfork.cpp +++ b/compiler-rt/test/hwasan/TestCases/Linux/atfork.cpp @@ -1,6 +1,6 @@ // RUN: %clang_hwasan -O0 %s -o %t && %run %t 2>&1 -// REQUIRES: aarch64-target-arch || x86_64-target-arch +// REQUIRES: aarch64-target-arch || x86_64-target-arch || riscv64-target-arch // REQUIRES: pointer-tagging #include diff --git a/compiler-rt/test/hwasan/TestCases/Linux/vfork.c b/compiler-rt/test/hwasan/TestCases/Linux/vfork.c --- a/compiler-rt/test/hwasan/TestCases/Linux/vfork.c +++ b/compiler-rt/test/hwasan/TestCases/Linux/vfork.c @@ -1,7 +1,7 @@ // https://github.com/google/sanitizers/issues/925 // RUN: %clang_hwasan -O0 %s -o %t && %run %t 2>&1 -// REQUIRES: aarch64-target-arch || x86_64-target-arch +// REQUIRES: aarch64-target-arch || x86_64-target-arch || riscv64-target-arch // REQUIRES: pointer-tagging #include diff --git a/compiler-rt/test/hwasan/TestCases/exported-tagged-global.c b/compiler-rt/test/hwasan/TestCases/exported-tagged-global.c --- a/compiler-rt/test/hwasan/TestCases/exported-tagged-global.c +++ b/compiler-rt/test/hwasan/TestCases/exported-tagged-global.c @@ -4,7 +4,10 @@ // RUN: %run %t // RUN: %clang_hwasan -O1 -mllvm --aarch64-enable-global-isel-at-O=1 %s -o %t // RUN: %run %t -// REQUIRES: aarch64-target-arch +// REQUIRES: aarch64-target-arch || riscv64-target-arch + +// For now RISC-V doesn't support tagging global variables +// XFAIL: riscv64-target-arch static int global; diff --git a/compiler-rt/test/hwasan/TestCases/stack-oob.c b/compiler-rt/test/hwasan/TestCases/stack-oob.c --- a/compiler-rt/test/hwasan/TestCases/stack-oob.c +++ b/compiler-rt/test/hwasan/TestCases/stack-oob.c @@ -10,7 +10,8 @@ // REQUIRES: stable-runtime // Stack short granules are currently not implemented on x86. -// XFAIL: x86_64 +// RISC-V target doesn't support oldrt +// XFAIL: x86_64, riscv64 #include #include diff --git a/compiler-rt/test/hwasan/TestCases/stack-uas.c b/compiler-rt/test/hwasan/TestCases/stack-uas.c --- a/compiler-rt/test/hwasan/TestCases/stack-uas.c +++ b/compiler-rt/test/hwasan/TestCases/stack-uas.c @@ -40,7 +40,7 @@ __attribute__((noinline)) char buggy() { char *volatile p; { - char zzz[0x1000]; + char zzz[0x1000] = {}; p = zzz; } return *p; diff --git a/compiler-rt/test/hwasan/TestCases/tag-mismatch-border-address.c b/compiler-rt/test/hwasan/TestCases/tag-mismatch-border-address.c --- a/compiler-rt/test/hwasan/TestCases/tag-mismatch-border-address.c +++ b/compiler-rt/test/hwasan/TestCases/tag-mismatch-border-address.c @@ -3,7 +3,7 @@ // RUN: not %run %t 2>&1 | FileCheck %s --check-prefix=CHECK // REQUIRES: stable-runtime -// REQUIRES: aarch64-target-arch +// REQUIRES: aarch64-target-arch || riscv64-target-arch #include #include diff --git a/compiler-rt/test/hwasan/TestCases/try-catch.cpp b/compiler-rt/test/hwasan/TestCases/try-catch.cpp --- a/compiler-rt/test/hwasan/TestCases/try-catch.cpp +++ b/compiler-rt/test/hwasan/TestCases/try-catch.cpp @@ -5,6 +5,7 @@ // RUN: %clangxx_hwasan_oldrt -static-libstdc++ %s -mllvm -hwasan-instrument-landing-pads=0 -o %t && not %run %t 2>&1 | FileCheck %s --check-prefix=BAD // C++ tests on x86_64 require instrumented libc++/libstdc++. +// RISC-V target doesn't support oldrt // REQUIRES: aarch64-target-arch #include 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 @@ -2,7 +2,7 @@ // RUN: %clangxx_hwasan -mllvm -hwasan-use-after-scope --std=c++11 -O1 %s -o %t && not %run %t 2>&1 | FileCheck %s -// REQUIRES: aarch64-target-arch +// REQUIRES: aarch64-target-arch || riscv64-target-arch // REQUIRES: stable-runtime #include 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 @@ -3,7 +3,7 @@ // RUN: %clangxx_hwasan -mllvm -hwasan-use-after-scope -O1 %s -o %t && \ // RUN: not %run %t 2>&1 | FileCheck %s -// REQUIRES: aarch64-target-arch +// REQUIRES: aarch64-target-arch || riscv64-target-arch // REQUIRES: stable-runtime #include 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 @@ -5,7 +5,7 @@ // Function jumps over variable initialization making lifetime analysis // ambiguous. Asan should ignore such variable and program must not fail. -// REQUIRES: aarch64-target-arch +// REQUIRES: aarch64-target-arch || riscv64-target-arch // REQUIRES: stable-runtime #include 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 @@ -3,7 +3,7 @@ // RUN: %clangxx_hwasan -mllvm -hwasan-use-after-scope -O1 %s -o %t && \ // RUN: not %run %t 2>&1 | FileCheck %s -// REQUIRES: aarch64-target-arch +// REQUIRES: aarch64-target-arch || riscv64-target-arch // REQUIRES: stable-runtime int *p; 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 @@ -7,7 +7,7 @@ // RUN: %clangxx_hwasan -mllvm -hwasan-use-after-scope -O2 %s -o %t && \ // RUN: not %run %t 2>&1 | FileCheck %s -// REQUIRES: aarch64-target-arch +// REQUIRES: aarch64-target-arch || riscv64-target-arch // REQUIRES: stable-runtime int *arr; 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 @@ -3,7 +3,7 @@ // RUN: %clangxx_hwasan -mllvm -hwasan-use-after-scope -O1 %s -o %t && \ // RUN: not %run %t 2>&1 | FileCheck %s -// REQUIRES: aarch64-target-arch +// REQUIRES: aarch64-target-arch || riscv64-target-arch // REQUIRES: stable-runtime volatile int *p; 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 @@ -3,7 +3,7 @@ // RUN: %clangxx_hwasan -mllvm -hwasan-use-after-scope -O1 %s -o %t && \ // RUN: not %run %t 2>&1 | FileCheck %s -// REQUIRES: aarch64-target-arch +// REQUIRES: aarch64-target-arch || riscv64-target-arch // REQUIRES: stable-runtime #include 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 @@ -3,7 +3,7 @@ // RUN: %clangxx_hwasan -mllvm -hwasan-use-after-scope -O1 %s -o %t && \ // RUN: not %run %t 2>&1 | FileCheck %s -// REQUIRES: aarch64-target-arch +// REQUIRES: aarch64-target-arch || riscv64-target-arch // REQUIRES: stable-runtime int *p[3]; diff --git a/compiler-rt/test/hwasan/TestCases/use-after-scope-nobug.cpp b/compiler-rt/test/hwasan/TestCases/use-after-scope-nobug.cpp --- a/compiler-rt/test/hwasan/TestCases/use-after-scope-nobug.cpp +++ b/compiler-rt/test/hwasan/TestCases/use-after-scope-nobug.cpp @@ -2,7 +2,7 @@ // RUN: %clangxx_hwasan -mllvm -hwasan-use-after-scope -O1 %s -o %t && %run %t -// REQUIRES: aarch64-target-arch +// REQUIRES: aarch64-target-arch || riscv64-target-arch // REQUIRES: stable-runtime #include diff --git a/compiler-rt/test/hwasan/TestCases/use-after-scope-setjmp.cpp b/compiler-rt/test/hwasan/TestCases/use-after-scope-setjmp.cpp --- a/compiler-rt/test/hwasan/TestCases/use-after-scope-setjmp.cpp +++ b/compiler-rt/test/hwasan/TestCases/use-after-scope-setjmp.cpp @@ -1,7 +1,7 @@ // RUN: %clangxx_hwasan -mllvm -hwasan-use-stack-safety=0 -mllvm -hwasan-use-after-scope -O2 %s -o %t && \ // RUN: %run %t 2>&1 -// REQUIRES: aarch64-target-arch +// REQUIRES: aarch64-target-arch || riscv64-target-arch // REQUIRES: stable-runtime #include 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 @@ -3,7 +3,7 @@ // RUN: %clangxx_hwasan -mllvm -hwasan-use-after-scope -std=c++11 -O1 %s -o %t && \ // RUN: not %run %t 2>&1 | FileCheck %s -// REQUIRES: aarch64-target-arch +// REQUIRES: aarch64-target-arch || riscv64-target-arch // REQUIRES: stable-runtime struct IntHolder { 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 @@ -3,7 +3,7 @@ // RUN: %clangxx_hwasan -mllvm -hwasan-use-after-scope -std=c++11 -O1 %s -o %t && \ // RUN: not %run %t 2>&1 | FileCheck %s -// REQUIRES: aarch64-target-arch +// REQUIRES: aarch64-target-arch || riscv64-target-arch // REQUIRES: stable-runtime struct IntHolder { 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 @@ -27,7 +27,7 @@ // RUN: not %run %t-noexcept 9 2>&1 | FileCheck %s // RUN: not %run %t-noexcept 10 2>&1 | FileCheck %s -// REQUIRES: aarch64-target-arch +// REQUIRES: aarch64-target-arch || riscv64-target-arch // REQUIRES: stable-runtime #include 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 @@ -3,7 +3,7 @@ // RUN: %clangxx_hwasan -mllvm -hwasan-use-after-scope -O1 %s -o %t && \ // RUN: not %run %t 2>&1 | FileCheck %s -// REQUIRES: aarch64-target-arch +// REQUIRES: aarch64-target-arch || riscv64-target-arch // REQUIRES: stable-runtime volatile int *p = 0;