diff options
author | Ian Lance Taylor <iant@google.com> | 2007-10-07 17:20:18 +0000 |
---|---|---|
committer | Ian Lance Taylor <iant@google.com> | 2007-10-07 17:20:18 +0000 |
commit | f958d5fc533970eb5f7083c3ab791912ee499bd4 (patch) | |
tree | 5906d45ce25ecd9d1bb84d139ed45f8f9d9b04ae /gold/testsuite/two_file_test_1.cc | |
parent | 6eee141ff6d84d39ca9e364eb98818431162d6df (diff) | |
download | gdb-f958d5fc533970eb5f7083c3ab791912ee499bd4.zip gdb-f958d5fc533970eb5f7083c3ab791912ee499bd4.tar.gz gdb-f958d5fc533970eb5f7083c3ab791912ee499bd4.tar.bz2 |
Test merging of string constants.
Diffstat (limited to 'gold/testsuite/two_file_test_1.cc')
-rw-r--r-- | gold/testsuite/two_file_test_1.cc | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/gold/testsuite/two_file_test_1.cc b/gold/testsuite/two_file_test_1.cc index 8857db4..d22d957 100644 --- a/gold/testsuite/two_file_test_1.cc +++ b/gold/testsuite/two_file_test_1.cc @@ -44,6 +44,7 @@ // 11 Pass function pointer from file 1 to file 2. // 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. #include "two_file_test.h" @@ -166,3 +167,16 @@ t13() { return &f13i == f13(); } + +// 14 Compare string constants in file 1 and file 2. + +bool +t14() +{ + const char* s1 = TEST_STRING_CONSTANT; + const char* s2 = f14(); + while (*s1 != '\0') + if (*s1++ != *s2++) + return false; + return *s2 == '\0'; +} |