]>
Commit | Line | Data |
---|---|---|
1a4d82fc JJ |
1 | // RUN: %clangxx_msan -m64 -O0 -g -xc++ %s -o %t && %run %t |
2 | // RUN: %clangxx_msan -m64 -O3 -g -xc++ %s -o %t && %run %t | |
3 | ||
4 | #include <stdio.h> | |
5 | #include <stdlib.h> | |
6 | ||
7 | int main(void) { | |
8 | char *buf; | |
9 | size_t buf_len = 42; | |
10 | FILE *fp = open_memstream(&buf, &buf_len); | |
11 | fprintf(fp, "hello"); | |
12 | fflush(fp); | |
13 | printf("buf_len = %zu\n", buf_len); | |
14 | for (int j = 0; j < buf_len; j++) { | |
15 | printf("buf[%d] = %c\n", j, buf[j]); | |
16 | } | |
17 | return 0; | |
18 | } |