summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/abi/guard2.C
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/g++.dg/abi/guard2.C')
-rw-r--r--gcc/testsuite/g++.dg/abi/guard2.C16
1 files changed, 16 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/abi/guard2.C b/gcc/testsuite/g++.dg/abi/guard2.C
new file mode 100644
index 000000000..988fd385b
--- /dev/null
+++ b/gcc/testsuite/g++.dg/abi/guard2.C
@@ -0,0 +1,16 @@
+// PR c++/41611
+// Test that the guard gets its own COMDAT group.
+// { dg-final { scan-assembler "_ZGVZN1A1fEvE1i,comdat" { target *-*-linux* } } }
+
+struct A {
+ static int f()
+ {
+ static int &i = *new int();
+ return i;
+ }
+};
+
+int main()
+{
+ return A::f();
+}