[ASan/Win] Use clang rather than clang-cl by default for lit tests. Make Windows...
[blocksruntime.git] / test / msan / getaddrinfo-positive.cc
blob7658cd504dba041c21a573f91422ed3406533778
1 // RUN: %clangxx_msan -m64 -O0 %s -o %t && not %run %t >%t.out 2>&1
2 // RUN: FileCheck %s < %t.out
3 // RUN: %clangxx_msan -m64 -O3 %s -o %t && not %run %t >%t.out 2>&1
4 // RUN: FileCheck %s < %t.out
6 #include <sys/types.h>
7 #include <sys/socket.h>
8 #include <netdb.h>
9 #include <stdlib.h>
11 volatile int z;
13 int main(void) {
14 struct addrinfo *ai;
15 struct addrinfo hint;
16 int res = getaddrinfo("localhost", NULL, NULL, &ai);
17 if (ai) z = 1; // OK
18 res = getaddrinfo("localhost", NULL, &hint, &ai);
19 // CHECK: Uninitialized bytes in __interceptor_getaddrinfo at offset 0 inside [0x{{.*}}, 48)
20 // CHECK: WARNING: MemorySanitizer: use-of-uninitialized-value
21 // CHECK: #0 {{.*}} in main {{.*}}getaddrinfo-positive.cc:[[@LINE-3]]
22 return 0;