aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/torture/pr119973.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gcc.dg/torture/pr119973.c')
-rw-r--r--gcc/testsuite/gcc.dg/torture/pr119973.c39
1 files changed, 39 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/torture/pr119973.c b/gcc/testsuite/gcc.dg/torture/pr119973.c
new file mode 100644
index 0000000..a9661a3
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/torture/pr119973.c
@@ -0,0 +1,39 @@
+/* { dg-do run } */
+/* { dg-additional-options "-fipa-pta" } */
+
+static int
+is_valid_domain_name (const char *string)
+{
+ const char *s;
+
+ for (s=string; *s; s++)
+ if (*s == '.')
+ {
+ if (string == s)
+ return 0;
+ }
+
+ return !!*string;
+}
+
+int
+main (void)
+{
+ static struct
+ {
+ const char *name;
+ int valid;
+ } testtbl[] =
+ {
+ { ".", 0 },
+ { nullptr, 0 }
+ };
+ int idx;
+
+ for (idx=0; testtbl[idx].name; idx++)
+ {
+ if (is_valid_domain_name (testtbl[idx].name) != testtbl[idx].valid)
+ __builtin_abort ();
+ }
+ return 0;
+}