diff options
Diffstat (limited to 'test/CodeGenCXX/const-init.cpp')
-rw-r--r-- | test/CodeGenCXX/const-init.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/test/CodeGenCXX/const-init.cpp b/test/CodeGenCXX/const-init.cpp index aa77d5c6c0..6fabfc762e 100644 --- a/test/CodeGenCXX/const-init.cpp +++ b/test/CodeGenCXX/const-init.cpp @@ -56,3 +56,16 @@ int writeToMutable() { const MutableMember MM = { 0 }; return ++MM.n; } + +// Make sure we don't try to fold this in the frontend; the backend can't +// handle it. +// CHECK: @PR11705 = global i128 0 +__int128_t PR11705 = (__int128_t)&PR11705; + +// Make sure we don't try to fold this either. +// CHECK: @_ZZ23UnfoldableAddrLabelDiffvE1x = internal global i128 0 +void UnfoldableAddrLabelDiff() { static __int128_t x = (long)&&a-(long)&&b; a:b:return;} + +// But make sure we do fold this. +// CHECK: @_ZZ21FoldableAddrLabelDiffvE1x = internal global i64 sub (i64 ptrtoint (i8* blockaddress(@_Z21FoldableAddrLabelDiffv, %a) +void FoldableAddrLabelDiff() { static long x = (long)&&a-(long)&&b; a:b:return;} |