Aaron Ballman ac2722873b Revert "Diagnose problematic uses of constructor/destructor attribute (#67673)"
This reverts commit 27ecb63c260400dd20b8c5dc16d0dfd2d0e7122e.

Still fails compiler-rt:
https://lab.llvm.org/buildbot/#/builders/109/builds/75364
2023-10-11 09:02:24 -04:00

27 lines
668 B
C++

// RUN: %clangxx -fsanitize=undefined -shared-libsan %s -o %t && %run %t 2>&1 | FileCheck %s
// Ensure ubsan runtime/interceptors are lazily initialized if called early.
// The test seems to segfault on aarch64 with tsan:
// https://lab.llvm.org/buildbot/#/builders/179/builds/6662
// Reason unknown, needs debugging.
// UNSUPPORTED: target=aarch64{{.*}} && ubsan-tsan
#include <assert.h>
#include <signal.h>
#include <stdio.h>
__attribute__((constructor(1))) void ctor() {
fprintf(stderr, "INIT\n");
struct sigaction old;
assert(!sigaction(SIGSEGV, nullptr, &old));
};
int main() {
fprintf(stderr, "DONE\n");
return 0;
}
// CHECK: INIT
// CHECK: DONE