Revert "CodeGen][NewPM] Port MachineScheduler to NPM. (#125703)" (#126268)
[llvm-project.git] / compiler-rt / test / builtins / Unit / dso_handle.cpp
blob183e29b8ac31ae31edbba6af258817456d7feebf
1 // REQUIRES: crt
3 // RUN: %clangxx -g -fno-exceptions -DCRT_SHARED -c %s -fPIC -o %tshared.o
4 // RUN: %clangxx -g -fno-exceptions -c %s -fPIC -o %t.o
5 // RUN: %clangxx -g -shared -o %t.so -nostdlib %crti %crtbegin %tshared.o %libstdcxx %libc -lm %libgcc %crtend %crtn
6 // RUN: %clangxx -g -o %t -fno-pic -no-pie -nostdlib %crt1 %crti %crtbegin %t.o %libstdcxx %libc -lm %libgcc %t.so %crtend %crtn
7 // RUN: %run %t 2>&1 | FileCheck %s
9 // UNSUPPORTED: target={{(arm|aarch64).*}}
11 #include <stdio.h>
13 // CHECK: 1
14 // CHECK-NEXT: ~A()
16 #ifdef CRT_SHARED
17 bool G;
18 void C() {
19 printf("%d\n", G);
22 struct A {
23 A() { G = true; }
24 ~A() {
25 printf("~A()\n");
29 A a;
30 #else
31 void C();
33 int main() {
34 C();
35 return 0;
37 #endif