1 // RUN: %clang_analyze_cc1 -analyzer-checker=optin.mpi.MPI-Checker -verify %s
5 // Use MPI-Checker to test 'getDescriptiveName', as the checker uses the
6 // function for diagnostics.
7 void testGetDescriptiveName() {
9 MPI_Comm_rank(MPI_COMM_WORLD
, &rank
);
11 MPI_Wait(&sendReq1
, MPI_STATUS_IGNORE
); // expected-warning{{Request 'sendReq1' has no matching nonblocking call.}}
14 void testGetDescriptiveName2() {
16 MPI_Comm_rank(MPI_COMM_WORLD
, &rank
);
17 MPI_Request sendReq1
[10][10][10];
18 MPI_Wait(&sendReq1
[1][7][9], MPI_STATUS_IGNORE
); // expected-warning{{Request 'sendReq1[1][7][9]' has no matching nonblocking call.}}
21 void testGetDescriptiveName3() {
23 MPI_Comm_rank(MPI_COMM_WORLD
, &rank
);
24 typedef struct { MPI_Request req
; } ReqStruct
;
26 MPI_Request
*r
= &rs
.req
;
27 MPI_Wait(r
, MPI_STATUS_IGNORE
); // expected-warning{{Request 'rs.req' has no matching nonblocking call.}}
30 void testGetDescriptiveName4() {
32 MPI_Comm_rank(MPI_COMM_WORLD
, &rank
);
33 typedef struct { MPI_Request req
[2][2]; } ReqStruct
;
35 MPI_Request
*r
= &rs
.req
[0][1];
36 MPI_Wait(r
, MPI_STATUS_IGNORE
); // expected-warning{{Request 'rs.req[0][1]' has no matching nonblocking call.}}
39 void testGetDescriptiveName5() {
41 MPI_Comm_rank(MPI_COMM_WORLD
, &rank
);
42 typedef struct { MPI_Request req
; } ReqStructInner
;
43 typedef struct { ReqStructInner req
; } ReqStruct
;
45 MPI_Request
*r
= &rs
.req
.req
;
46 MPI_Wait(r
, MPI_STATUS_IGNORE
); // expected-warning{{Request 'rs.req.req' has no matching nonblocking call.}}