summaryrefslogtreecommitdiffstats
path: root/gcc/testsuite/gcc.c-torture/execute/string-opt-12.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gcc.c-torture/execute/string-opt-12.c')
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/string-opt-12.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.c-torture/execute/string-opt-12.c b/gcc/testsuite/gcc.c-torture/execute/string-opt-12.c
index 0126b85b81d..ebe47e5b0e3 100644
--- a/gcc/testsuite/gcc.c-torture/execute/string-opt-12.c
+++ b/gcc/testsuite/gcc.c-torture/execute/string-opt-12.c
@@ -34,6 +34,17 @@ int main ()
strcpy (dst, s1); d2 = dst;
if (strcspn (++d2+5, "") != 5 || d2 != dst+1)
abort();
+ if (strcspn ("", s1) != 0)
+ abort();
+ strcpy (dst, s1);
+ if (strcspn ("", dst) != 0)
+ abort();
+ strcpy (dst, s1); d2 = dst;
+ if (strcspn ("", ++d2) != 0 || d2 != dst+1)
+ abort();
+ strcpy (dst, s1); d2 = dst;
+ if (strcspn ("", ++d2+5) != 0 || d2 != dst+1)
+ abort();
return 0;
}
OpenPOWER on IntegriCloud