File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change
1
+ // REQUIRES: host-supports-jit
1
2
// UNSUPPORTED: system-aix
2
3
3
4
// RUN: cat %s | clang-repl | FileCheck %s
4
5
int *x = new int ();
5
6
template <class T > struct GuardX { T *&x; GuardX(T *&x) : x(x) {}; ~GuardX (); };
6
- template <class T > GuardX<T>::~GuardX () { delete x; x = nullptr ; }
7
7
8
- // clang would normally defer codegen for ~GuardX()
9
- // Make sure that RuntimeInterfaceBuilder requests it explicitly
8
+ // clang normally defers codegen for this out-of-line ~GuardX(), which would
9
+ // cause the JIT to report Symbols not found: [ _ZN6GuardXIiED2Ev ]
10
+ extern " C" int printf (const char *, ...);
11
+ template <class T > GuardX<T>::~GuardX () { delete x; printf (" Running dtor\n " ); }
12
+
13
+ // Let's make sure that the RuntimeInterfaceBuilder requests it explicitly:
10
14
(GuardX(x))
11
15
12
16
// CHECK-NOT: Symbols not found
13
- // CHECK-NOT: _ZN6GuardXIiED2Ev
17
+ // CHECK: Running dtor
You can’t perform that action at this time.
0 commit comments