Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / compiler-rt / test / ubsan / TestCases / Misc / Linux / sigaction.cpp
blob0ab65bd30d92cc8ebb0d3c1f68081c3d5ec2567d
1 // RUN: %clangxx -fsanitize=undefined -shared-libsan %s -o %t && %run %t 2>&1 | FileCheck %s
3 // Ensure ubsan runtime/interceptors are lazily initialized if called early.
5 // The test seems to segfault on aarch64 with tsan:
6 // https://lab.llvm.org/buildbot/#/builders/179/builds/6662
7 // Reason unknown, needs debugging.
8 // UNSUPPORTED: target=aarch64{{.*}} && ubsan-tsan
10 #include <assert.h>
11 #include <signal.h>
12 #include <stdio.h>
14 __attribute__((constructor(1))) void ctor() {
15 fprintf(stderr, "INIT\n");
16 struct sigaction old;
17 assert(!sigaction(SIGSEGV, nullptr, &old));
20 int main() {
21 fprintf(stderr, "DONE\n");
22 return 0;
25 // CHECK: INIT
26 // CHECK: DONE