aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/libgdiagnostics.dg/test-logical-location.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/libgdiagnostics.dg/test-logical-location.c')
-rw-r--r--gcc/testsuite/libgdiagnostics.dg/test-logical-location.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/gcc/testsuite/libgdiagnostics.dg/test-logical-location.c b/gcc/testsuite/libgdiagnostics.dg/test-logical-location.c
index 1408919..b59ece4 100644
--- a/gcc/testsuite/libgdiagnostics.dg/test-logical-location.c
+++ b/gcc/testsuite/libgdiagnostics.dg/test-logical-location.c
@@ -20,6 +20,7 @@ PRINT "hello world!";
const int line_num = __LINE__ - 2;
#include <assert.h>
+#include <string.h>
int
main ()
@@ -62,6 +63,17 @@ main ()
diagnostic_finish (d, "can't find %qs", "foo");
/* end quoted source */
+ /* Verify that the accessors work. */
+ assert (diagnostic_logical_location_get_kind (logical_loc)
+ == DIAGNOSTIC_LOGICAL_LOCATION_KIND_FUNCTION);
+ assert (!diagnostic_logical_location_get_parent (logical_loc));
+ assert (!strcmp (diagnostic_logical_location_get_short_name (logical_loc),
+ "test_short_name"));
+ assert (!strcmp (diagnostic_logical_location_get_fully_qualified_name (logical_loc),
+ "test_qualified_name"));
+ assert (!strcmp (diagnostic_logical_location_get_decorated_name (logical_loc),
+ "test_decorated_name"));
+
/* Verify that creating a diagnostic_logical_location with equal values
yields the same instance. */
const diagnostic_logical_location *dup