summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/format
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gcc.dg/format')
-rw-r--r--gcc/testsuite/gcc.dg/format/sentinel-1.c39
1 files changed, 23 insertions, 16 deletions
diff --git a/gcc/testsuite/gcc.dg/format/sentinel-1.c b/gcc/testsuite/gcc.dg/format/sentinel-1.c
index 12915b7dc5a..1dc090870e4 100644
--- a/gcc/testsuite/gcc.dg/format/sentinel-1.c
+++ b/gcc/testsuite/gcc.dg/format/sentinel-1.c
@@ -27,40 +27,47 @@ extern void foo10 (const char *, ...) __attribute__ ((__sentinel__(1,3))); /* {
extern void bar(void)
{
- foo1 (); /* { dg-error "missing sentinel|too few arguments" "sentinel" } */
- foo1 ("a"); /* { dg-warning "missing sentinel" "sentinel" } */
+ foo1 (); /* { dg-error "not enough|too few arguments" "sentinel" } */
+ foo1 (NULL); /* { dg-warning "not enough" "sentinel" } */
+ foo1 ("a"); /* { dg-warning "not enough" "sentinel" } */
foo1 ("a", 1); /* { dg-warning "missing sentinel" "sentinel" } */
foo1 ("a", 0); /* { dg-warning "missing sentinel" "sentinel" } */
foo1 ("a", (void*)1); /* { dg-warning "missing sentinel" "sentinel" } */
foo1 ("a", NULL, 1); /* { dg-warning "missing sentinel" "sentinel" } */
foo1 ("a", NULL);
+ foo5 (NULL); /* { dg-warning "not enough" "sentinel" } */
+ foo5 (NULL, 1); /* { dg-warning "not enough" "sentinel" } */
+ foo5 ("a", NULL); /* { dg-warning "not enough" "sentinel" } */
+ foo5 ("a", NULL, 1);
foo5 ("a", 1, 2, 3, NULL); /* { dg-warning "missing sentinel" "sentinel" } */
foo5 ("a", 1, 2, NULL, 3);
foo5 ("a", 1, NULL, 2, 3); /* { dg-warning "missing sentinel" "sentinel" } */
foo5 ("a", NULL, 1, 2, 3); /* { dg-warning "missing sentinel" "sentinel" } */
foo5 ("a", 0, 1, 2, 3); /* { dg-warning "missing sentinel" "sentinel" } */
- foo6 ("a", 1, NULL); /* { dg-warning "not enough arguments" "sentinel" } */
- foo6 ("a", 1, NULL, 2); /* { dg-warning "not enough arguments" "sentinel" } */
- foo6 ("a", 1, NULL, 2, 3); /* { dg-warning "not enough arguments" "sentinel" } */
- foo6 ("a", NULL, 1, 2, 3); /* { dg-warning "not enough arguments" "sentinel" } */
- foo6 ("a", NULL, 1, 2, 3, 4); /* { dg-warning "missing sentinel" "sentinel" } */
+ foo6 ("a", 1, NULL); /* { dg-warning "not enough" "sentinel" } */
+ foo6 ("a", 1, NULL, 2); /* { dg-warning "not enough" "sentinel" } */
+ foo6 ("a", 1, NULL, 2, 3); /* { dg-warning "not enough" "sentinel" } */
+ foo6 ("a", NULL, 1, 2, 3); /* { dg-warning "not enough" "sentinel" } */
+ foo6 ("a", NULL, 1, 2, 3, 4); /* { dg-warning "not enough" "sentinel" } */
+ foo6 (NULL, 1, 2, 3, 4, 5); /* { dg-warning "not enough" "sentinel" } */
foo6 ("a", NULL, 1, 2, 3, 4, 5);
+ foo6 ("a", 0, NULL, 1, 2, 3, 4, 5);
foo6 ("a", 0, 1, 2, 3, 4, 5); /* { dg-warning "missing sentinel" "sentinel" } */
foo6 ("a", NULL, 1, 2, 3, 4, 5, 6); /* { dg-warning "missing sentinel" "sentinel" } */
foo7 ("a", 1, 2, 3, NULL);
- execl ("/bin/ls", "-aFC"); /* { dg-warning "missing sentinel" "sentinel" } */
- execl ("/bin/ls", "-aFC", 0); /* { dg-warning "missing sentinel" "sentinel" } */
- execl ("/bin/ls", "-aFC", NULL);
+ execl ("/bin/ls", "/bin/ls", "-aFC"); /* { dg-warning "missing sentinel" "sentinel" } */
+ execl ("/bin/ls", "/bin/ls", "-aFC", 0); /* { dg-warning "missing sentinel" "sentinel" } */
+ execl ("/bin/ls", "/bin/ls", "-aFC", NULL);
- execlp ("ls", "-aFC"); /* { dg-warning "missing sentinel" "sentinel" } */
- execlp ("ls", "-aFC", 0); /* { dg-warning "missing sentinel" "sentinel" } */
- execlp ("ls", "-aFC", NULL);
+ execlp ("ls", "ls", "-aFC"); /* { dg-warning "missing sentinel" "sentinel" } */
+ execlp ("ls", "ls", "-aFC", 0); /* { dg-warning "missing sentinel" "sentinel" } */
+ execlp ("ls", "ls", "-aFC", NULL);
- execle ("ls", "-aFC", ".", envp); /* { dg-warning "missing sentinel" "sentinel" } */
- execle ("ls", "-aFC", ".", 0, envp); /* { dg-warning "missing sentinel" "sentinel" } */
- execle ("ls", "-aFC", ".", NULL, envp);
+ execle ("ls", "ls", "-aFC", ".", envp); /* { dg-warning "missing sentinel" "sentinel" } */
+ execle ("ls", "ls", "-aFC", ".", 0, envp); /* { dg-warning "missing sentinel" "sentinel" } */
+ execle ("ls", "ls", "-aFC", ".", NULL, envp);
}