diff options
Diffstat (limited to 'gcc/testsuite/g++.dg/opt/const5.C')
-rw-r--r-- | gcc/testsuite/g++.dg/opt/const5.C | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/opt/const5.C b/gcc/testsuite/g++.dg/opt/const5.C new file mode 100644 index 000000000..3785271a0 --- /dev/null +++ b/gcc/testsuite/g++.dg/opt/const5.C @@ -0,0 +1,13 @@ +// We don't have a good way of determining how ".rodata" is spelled on +// all targets, so we limit this test to a few common targets where we +// do know the spelling. +// { dg-do compile { target i?86-*-linux* x86_64-*-linux* } } +// { dg-final { scan-assembler "\\.rodata" } } + +template <typename T> +struct B { + int i; +}; + +// This declaration should be placed in .rodata. +const B<int> const_B __attribute__((used)) = { 3 }; |