| 1 |
#include <cstdio> |
| 2 |
|
| 3 |
#include "llvm/ADT/PointerUnion.h" |
| 4 |
|
| 5 |
int main() { |
| 6 |
int a = 5; |
| 7 |
float f = 4.0; |
| 8 |
struct alignas(8) Z {}; |
| 9 |
Z z; |
| 10 |
|
| 11 |
struct Derived : public Z {}; |
| 12 |
Derived derived; |
| 13 |
|
| 14 |
llvm::PointerUnion<Z *, float *> z_float(&f); |
| 15 |
llvm::PointerUnion<Z *, float *> raw_z_float(nullptr); |
| 16 |
|
| 17 |
llvm::PointerUnion<long long *, int *, float *> long_int_float(&a); |
| 18 |
llvm::PointerUnion<Z *> z_only(&z); |
| 19 |
|
| 20 |
llvm::PointerIntPair<llvm::PointerUnion<Z *, float *>, 1> union_int_pair( |
| 21 |
z_float, 1); |
| 22 |
|
| 23 |
puts("Break here"); |
| 24 |
|
| 25 |
z_float = &derived; |
| 26 |
|
| 27 |
puts("Break here"); |
| 28 |
} |