Skip to content

Commit 847fa84

Browse files
[RISC-V][HWASAN] Adjust lit test support for RISC-V HWASAN feature
Reviewed by: vitalybuka Differential Revision: https://reviews.llvm.org/D131344
1 parent e07149c commit 847fa84

21 files changed

+25
-20
lines changed

compiler-rt/test/hwasan/TestCases/Linux/atfork.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// RUN: %clang_hwasan -O0 %s -o %t && %run %t 2>&1
22

3-
// REQUIRES: aarch64-target-arch || x86_64-target-arch
3+
// REQUIRES: aarch64-target-arch || x86_64-target-arch || riscv64-target-arch
44
// REQUIRES: pointer-tagging
55

66
#include <assert.h>

compiler-rt/test/hwasan/TestCases/Linux/vfork.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// https://github.com/google/sanitizers/issues/925
22
// RUN: %clang_hwasan -O0 %s -o %t && %run %t 2>&1
33

4-
// REQUIRES: aarch64-target-arch || x86_64-target-arch
4+
// REQUIRES: aarch64-target-arch || x86_64-target-arch || riscv64-target-arch
55
// REQUIRES: pointer-tagging
66

77
#include <assert.h>

compiler-rt/test/hwasan/TestCases/exported-tagged-global.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,10 @@
44
// RUN: %run %t
55
// RUN: %clang_hwasan -O1 -mllvm --aarch64-enable-global-isel-at-O=1 %s -o %t
66
// RUN: %run %t
7-
// REQUIRES: aarch64-target-arch
7+
// REQUIRES: aarch64-target-arch || riscv64-target-arch
8+
9+
// This test relies on aarch64 option thus it fails for risc-v
10+
// XFAIL: riscv64-target-arch
811

912
static int global;
1013

compiler-rt/test/hwasan/TestCases/stack-oob.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@
1010
// REQUIRES: stable-runtime
1111

1212
// Stack short granules are currently not implemented on x86.
13-
// XFAIL: x86_64
13+
// RISC-V target doesn't support oldrt
14+
// XFAIL: x86_64, riscv64
1415

1516
#include <stdlib.h>
1617
#include <sanitizer/hwasan_interface.h>

compiler-rt/test/hwasan/TestCases/stack-uas.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ __attribute__((noinline)) void Unrelated3() {
4040
__attribute__((noinline)) char buggy() {
4141
char *volatile p;
4242
{
43-
char zzz[0x1000];
43+
char zzz[0x1000] = {};
4444
p = zzz;
4545
}
4646
return *p;

compiler-rt/test/hwasan/TestCases/tag-mismatch-border-address.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// RUN: not %run %t 2>&1 | FileCheck %s --check-prefix=CHECK
44

55
// REQUIRES: stable-runtime
6-
// REQUIRES: aarch64-target-arch
6+
// REQUIRES: aarch64-target-arch || riscv64-target-arch
77

88
#include <sanitizer/hwasan_interface.h>
99
#include <stdio.h>

compiler-rt/test/hwasan/TestCases/try-catch.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
// 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
66

77
// C++ tests on x86_64 require instrumented libc++/libstdc++.
8+
// RISC-V target doesn't support oldrt
89
// REQUIRES: aarch64-target-arch
910

1011
#include <stdexcept>

compiler-rt/test/hwasan/TestCases/use-after-scope-capture.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
// RUN: %clangxx_hwasan -mllvm -hwasan-use-after-scope --std=c++11 -O1 %s -o %t && not %run %t 2>&1 | FileCheck %s
44

5-
// REQUIRES: aarch64-target-arch
5+
// REQUIRES: aarch64-target-arch || riscv64-target-arch
66
// REQUIRES: stable-runtime
77

88
#include <functional>

compiler-rt/test/hwasan/TestCases/use-after-scope-dtor-order.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// RUN: %clangxx_hwasan -mllvm -hwasan-use-after-scope -O1 %s -o %t && \
44
// RUN: not %run %t 2>&1 | FileCheck %s
55

6-
// REQUIRES: aarch64-target-arch
6+
// REQUIRES: aarch64-target-arch || riscv64-target-arch
77
// REQUIRES: stable-runtime
88

99
#include <stdio.h>

compiler-rt/test/hwasan/TestCases/use-after-scope-goto.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
// Function jumps over variable initialization making lifetime analysis
66
// ambiguous. Asan should ignore such variable and program must not fail.
77

8-
// REQUIRES: aarch64-target-arch
8+
// REQUIRES: aarch64-target-arch || riscv64-target-arch
99
// REQUIRES: stable-runtime
1010

1111
#include <stdlib.h>

0 commit comments

Comments
 (0)