Skip to content

Commit 1fff41e

Browse files
committed
[PR] Maskray - rename test files, fix variable case
1 parent f056657 commit 1fff41e

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

compiler-rt/test/rtsan/test_rtsan.cpp renamed to compiler-rt/test/rtsan/basic.cpp

+5-1
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,13 @@
55
// Intent: Ensure that an intercepted call in a [[clang::nonblocking]] function
66
// is flagged as an error. Basic smoke test.
77

8+
#include <stdio.h>
89
#include <stdlib.h>
910

10-
void violation() [[clang::nonblocking]] { void *Ptr = malloc(2); }
11+
void violation() [[clang::nonblocking]] {
12+
void *ptr = malloc(2);
13+
printf("ptr: %p\n", ptr); // ensure we don't optimize out the malloc
14+
}
1115

1216
int main() {
1317
violation();

compiler-rt/test/rtsan/test_rtsan_inactive.cpp renamed to compiler-rt/test/rtsan/inactive.cpp

+4-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,10 @@
99

1010
// In this test, we don't use the -fsanitize=realtime flag, so nothing
1111
// should happen here
12-
void violation() [[clang::nonblocking]] { void *Ptr = malloc(2); }
12+
void violation() [[clang::nonblocking]] {
13+
void *ptr = malloc(2);
14+
printf("ptr: %p\n", ptr); // ensure we don't optimize out the malloc
15+
}
1316

1417
int main() {
1518
printf("Starting run\n");

0 commit comments

Comments
 (0)