blob: 3af6d4f0ff190e64deb6c66b5772827aea7ca200 [file] [log] [blame]
bartd77a4ca2014-06-28 07:18:33 +00001/* Tests Valgrind moans about unknown ioctl.
2 10 unique moans should be produced.
3 */
4
Elliott Hughesa0664b92017-04-18 17:46:52 -07005#include <unistd.h>
bartd77a4ca2014-06-28 07:18:33 +00006#include <sys/ioctl.h>
7
florian21628d22015-03-14 15:54:05 +00008/* An ioctl request for a strange ioctl device driver.
9 The choice of values here needs to match the logic in
10 ML_(PRE_unknown_ioctl) and take into account that _IOC_NONE
11 is not == 0 everywhere. */
sewardj8eb8bab2015-07-21 14:44:28 +000012# if defined(VGO_linux)
florian21628d22015-03-14 15:54:05 +000013#define IOCTL_REQUEST_BASE (0x12345670 | _IOC(_IOC_NONE,0,0,0))
rhyskidd05d2cab2015-03-21 06:35:32 +000014# else
15#define IOCTL_REQUEST_BASE 0x12345670
16# endif
bartd77a4ca2014-06-28 07:18:33 +000017
18int main(int argc, const char *argv[])
19{
20 ioctl(-1, IOCTL_REQUEST_BASE + 0x0);
21 ioctl(-1, IOCTL_REQUEST_BASE + 0x1);
22 ioctl(-1, IOCTL_REQUEST_BASE + 0x0);
23 ioctl(-1, IOCTL_REQUEST_BASE + 0x2);
24 ioctl(-1, IOCTL_REQUEST_BASE + 0x3);
25 ioctl(-1, IOCTL_REQUEST_BASE + 0x4);
26 ioctl(-1, IOCTL_REQUEST_BASE + 0x1);
27 ioctl(-1, IOCTL_REQUEST_BASE + 0x5);
28 ioctl(-1, IOCTL_REQUEST_BASE + 0x5);
29 ioctl(-1, IOCTL_REQUEST_BASE + 0x1);
30 ioctl(-1, IOCTL_REQUEST_BASE + 0x6);
31 ioctl(-1, IOCTL_REQUEST_BASE + 0x7);
32 ioctl(-1, IOCTL_REQUEST_BASE + 0x8);
33 ioctl(-1, IOCTL_REQUEST_BASE + 0x1);
34 ioctl(-1, IOCTL_REQUEST_BASE + 0x9);
35 ioctl(-1, IOCTL_REQUEST_BASE + 0x1);
36 ioctl(-1, IOCTL_REQUEST_BASE + 0x0);
37 ioctl(-1, IOCTL_REQUEST_BASE + 0xa);
38 ioctl(-1, IOCTL_REQUEST_BASE + 0xb);
39 ioctl(-1, IOCTL_REQUEST_BASE + 0xc);
40 ioctl(-1, IOCTL_REQUEST_BASE + 0xd);
41 ioctl(-1, IOCTL_REQUEST_BASE + 0x1);
42 ioctl(-1, IOCTL_REQUEST_BASE + 0xe);
43 ioctl(-1, IOCTL_REQUEST_BASE + 0x0);
44 ioctl(-1, IOCTL_REQUEST_BASE + 0xf);
45
46 return 0;
47}