================
@@ -306,6 +320,33 @@ void call_recv_runtime(int fd, int n) {
   recvfrom(fd, buf, n, 0, (struct sockaddr *)0, 0);
 }
 
+void call_poll(void) {
+  struct pollfd fds[2];
+  struct pollfd single_fd;
+  poll(fds, 2, 0);
+  poll(fds, 3, 0); // expected-warning {{'poll' size argument is too large; 
destination buffer has size 16, but size argument is 24}}
+  poll(fds, -1, 0); // expected-warning {{'poll' size argument is too large; 
destination buffer has size 16, but size argument is }}
----------------
Expertcoderz wrote:

> Use the (sadly, undocumented) `expected-warning-re`? You can find examples 
> throughout clang/test/ using this.

Regex matching appears to be somewhat documented in the internals manual: 
https://clang.llvm.org/docs/InternalsManual.html#diagnostic-text

https://github.com/llvm/llvm-project/pull/226261
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to