Fix foreach_with_prefix regression
[deliverable/binutils-gdb.git] / gold / testsuite / two_file_test_1.cc
index d22d95757377c606a2d0da42597e1a01a24fcae2..8d1f5f71f9cf4132687262af74b897b6472e4b53 100644 (file)
@@ -1,6 +1,6 @@
 // two_file_test_1.cc -- a two file test case for gold, file 1 of 2
 
-// Copyright 2006, 2007 Free Software Foundation, Inc.
+// Copyright (C) 2006-2019 Free Software Foundation, Inc.
 // Written by Ian Lance Taylor <iant@google.com>.
 
 // This file is part of gold.
@@ -20,6 +20,9 @@
 // Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
 // MA 02110-1301, USA.
 
+// For incremental linking tests, this file needs to be compiled with
+// -fno-exceptions -fno-asynchronous-unwind-tables.
+
 // This tests references between files.  This is file 1, and
 // two_file_test_2.cc is file 2.  We test in several different ways:
 
 // 12 Compare address of function for equality in both files.
 // 13 Compare address of inline function for equality in both files.
 // 14 Compare string constants in file 1 and file 2.
+// 15 Compare wide string constants in file 1 and file 2.
+// 16 Call a function directly after its address has been taken.
+// 17 File 1 checks array of string constants defined in file 2.
+// 18 File 1 checks string constants referenced in code in file 2.
 
 #include "two_file_test.h"
 
@@ -180,3 +187,55 @@ t14()
       return false;
   return *s2 == '\0';
 }
+
+// 15 Compare wide string constants in file 1 and file 2.
+
+bool
+t15()
+{
+  const wchar_t* s1 = TEST_WIDE_STRING_CONSTANT;
+  const wchar_t* s2 = f15();
+  while (*s1 != '\0')
+    if (*s1++ != *s2++)
+      return false;
+  return *s2 == '\0';
+}
+
+// 16 Call a function directly after its address has been taken.
+
+bool
+t16()
+{
+  return f10() == 135;
+}
+
+// 17 File 1 checks array of string constants defined in file 2.
+
+bool
+t17()
+{
+  char c = 'a';
+  for (int i = 0; i < T17_COUNT; ++i)
+    {
+      if (t17data[i][0] != c || t17data[i][1] != '\0')
+       return false;
+      ++c;
+    }
+  return true;
+}
+
+// 18 File 1 checks string constants referenced in code in file 2.
+
+bool
+t18()
+{
+  char c = 'a';
+  for (int i = 0; i < T17_COUNT; ++i)
+    {
+      const char* s = f18(i);
+      if (s[0] != c || s[1] != '\0')
+        return false;
+      ++c;
+    }
+  return true;
+}
This page took 0.025614 seconds and 4 git commands to generate.