[PowerPC] Collect some CallLowering arguments into a struct. [NFC]
[llvm-project.git] / compiler-rt / test / hwasan / TestCases / Linux / vfork.c
blob84e960279673c65f9aa6ceb2c5596595c2f4a40d
1 // https://github.com/google/sanitizers/issues/925
2 // RUN: %clang_hwasan -O0 %s -o %t && %run %t 2>&1
4 // REQUIRES: aarch64-target-arch || x86_64-target-arch
6 #include <assert.h>
7 #include <sys/types.h>
8 #include <sys/wait.h>
9 #include <unistd.h>
10 #include <stdio.h>
11 #include <sanitizer/hwasan_interface.h>
13 __attribute__((noinline, no_sanitize("hwaddress"))) void child() {
14 char x[10000];
15 __hwasan_tag_memory(x, 0xAA, sizeof(x));
16 _exit(0);
19 __attribute__((noinline, no_sanitize("hwaddress"))) void parent() {
20 char x[10000];
21 __hwasan_print_shadow(&x, sizeof(x));
22 assert(__hwasan_test_shadow(x, sizeof(x)) == -1);
25 int main(int argc, char **argv) {
26 if (vfork())
27 parent();
28 else
29 child();
31 return 0;