aboutsummaryrefslogtreecommitdiff
path: root/gold/testsuite/debug_msg.cc
diff options
context:
space:
mode:
authorIan Lance Taylor <iant@google.com>2007-11-14 01:03:01 +0000
committerIan Lance Taylor <iant@google.com>2007-11-14 01:03:01 +0000
commita55ce7febfaa52670ce3d9c236d3033de80ac091 (patch)
tree5955950569cfe09f083ba0e217a1a8085a844103 /gold/testsuite/debug_msg.cc
parentb3c8c50a8f21a913e6c5dc91ff843cd4e924b01a (diff)
downloadgdb-a55ce7febfaa52670ce3d9c236d3033de80ac091.zip
gdb-a55ce7febfaa52670ce3d9c236d3033de80ac091.tar.gz
gdb-a55ce7febfaa52670ce3d9c236d3033de80ac091.tar.bz2
From Craig Silverstein: Rework debug info code a bit, add option for
ODR violations, add test case.
Diffstat (limited to 'gold/testsuite/debug_msg.cc')
-rw-r--r--gold/testsuite/debug_msg.cc12
1 files changed, 12 insertions, 0 deletions
diff --git a/gold/testsuite/debug_msg.cc b/gold/testsuite/debug_msg.cc
index ab73a8d..45a0be6 100644
--- a/gold/testsuite/debug_msg.cc
+++ b/gold/testsuite/debug_msg.cc
@@ -55,6 +55,10 @@ class Derived : public Base
virtual void virtfn() { undef_fn2(); }
};
+// This tests One Definition Rule (ODR) violations.
+void SortAscending(int array[], int size); // in odr_violation1.cc
+void SortDescending(int array[], int size); // in odr_violation2.cc
+
int main()
{
testfn(5);
@@ -63,5 +67,13 @@ int main()
Base b;
Derived d;
+ int kInput1[] = {1, 6, 9, 7, 3, 4, 2, 10, 5, 8};
+ int kSize1 = sizeof(kInput1) / sizeof(int);
+ SortAscending(kInput1, kSize1);
+
+ int kInput2[] = {1, 6, 9, 7, 3, 4, 2, 10, 5, 8};
+ int kSize2 = sizeof(kInput2) / sizeof(int);
+ SortDescending(kInput2, kSize2);
+
return 0;
}