Mercurial > hg > CbC > CbC_llvm
view compiler-rt/test/msan/interception_sigaction_test.cpp @ 222:81f6424ef0e3 llvm-original
LLVM original branch
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Sun, 18 Jul 2021 22:10:01 +0900 |
parents | 79ff65ed7e25 |
children |
line wrap: on
line source
// RUN: %clangxx_msan -O0 -g %s -o %t // RUN: MSAN_OPTIONS=handle_segv=2 %t 2>&1 | FileCheck %s #include <stdlib.h> #include <stdio.h> #include <unistd.h> #include <signal.h> #include <string.h> extern "C" int __interceptor_sigaction(int signum, const struct sigaction *act, struct sigaction *oldact); extern "C" int sigaction(int signum, const struct sigaction *act, struct sigaction *oldact) { write(2, "sigaction call\n", sizeof("sigaction call\n") - 1); return __interceptor_sigaction(signum, act, oldact); } int main() { struct sigaction oldact; sigaction(SIGSEGV, nullptr, &oldact); if (oldact.sa_handler || oldact.sa_sigaction) { fprintf(stderr, "oldact filled\n"); } return 0; // CHECK: sigaction call // CHECK: oldact filled }