Remove alloca(0) calls
[deliverable/binutils-gdb.git] / gold / testsuite / icf_safe_test.cc
index 9e8a36946b8d8f2b85fb5ff899ae03328992e7fa..18ff2106060f78d751e122f94c649dc597723824 100644 (file)
@@ -1,6 +1,6 @@
 // icf_safe_test.cc -- a test case for gold
 
-// Copyright 2009 Free Software Foundation, Inc.
+// Copyright (C) 2009-2019 Free Software Foundation, Inc.
 // Written by Sriraman Tallam <tmsriram@google.com>.
 
 // This file is part of gold.
 
 // The goal of this program is to verify if identical code folding
 // in safe mode correctly folds only ctors and dtors. kept_func_1 must
-// not be folded into kept_func_2.  The ctor and dtor of class A must
-// be folded.
+// not be folded into kept_func_2 other than for X86 (32 and 64 bit)
+// which can use relocation types to determine if function pointers are
+// taken.  kept_func_3 should never be folded as its pointer is taken.
+// The ctor and dtor of class A must be folded.
 
 class A
 {
@@ -48,7 +50,14 @@ int kept_func_2()
   return 1;
 }
 
+int kept_func_3()
+{
+  return 1;
+}
+
 int main()
 {
+  int (*p)() = kept_func_3;
+  p();
   return 0;
 }
This page took 0.023725 seconds and 4 git commands to generate.