diff options
Diffstat (limited to 'gcc/testsuite/g++.dg/opt/pr55081.C')
-rw-r--r-- | gcc/testsuite/g++.dg/opt/pr55081.C | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/opt/pr55081.C b/gcc/testsuite/g++.dg/opt/pr55081.C new file mode 100644 index 00000000000..b4f533e5a73 --- /dev/null +++ b/gcc/testsuite/g++.dg/opt/pr55081.C @@ -0,0 +1,17 @@ +// PR c++/55081 +// { dg-do compile } + +struct R { int field; } r; + +__UINTPTR_TYPE__ * +foo () +{ + static __UINTPTR_TYPE__ array[] = { + sizeof (char), + (reinterpret_cast <__UINTPTR_TYPE__>(&r.field) + - reinterpret_cast <__UINTPTR_TYPE__>(&r)) + 1 + }; + return array; +} + +// { dg-final { scan-assembler-not "_ZGVZ3foovE5array" } } |