summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/ipa/pr63621.C
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/g++.dg/ipa/pr63621.C')
-rw-r--r--gcc/testsuite/g++.dg/ipa/pr63621.C30
1 files changed, 30 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/ipa/pr63621.C b/gcc/testsuite/g++.dg/ipa/pr63621.C
new file mode 100644
index 0000000000..3fe3f2f2c4
--- /dev/null
+++ b/gcc/testsuite/g++.dg/ipa/pr63621.C
@@ -0,0 +1,30 @@
+// { dg-do compile }
+// { dg-require-effective-target named_sections }
+ class A
+{
+ public:
+ int __attribute__((section("a"))) f1(bool);
+ int f2(void *);
+ int f3(bool);
+};
+
+inline int A::f1(bool b)
+{
+ static int c;
+ if (c)
+ ;
+ return 0;
+}
+
+inline int A::f3(bool b)
+{
+ static __attribute__((section(""))) int c;
+ if (c)
+ ;
+ return 0;
+}
+
+int A::f2(void *c)
+{
+ return f1(c) + f3(c);
+}