brintos

brintos / llvm-project-archived public Read only

0
0
Text · 827 B · 60e1c1e Raw
18 lines · c
1/* RUN: %clang_cc1 -std=c89 -fsyntax-only -Wuninitialized -verify %s2   RUN: %clang_cc1 -std=c99 -fsyntax-only -Wuninitialized -verify %s3   RUN: %clang_cc1 -std=c11 -fsyntax-only -Wuninitialized -verify %s4   RUN: %clang_cc1 -std=c17 -fsyntax-only -Wuninitialized -verify %s5   RUN: %clang_cc1 -std=c2x -fsyntax-only -Wuninitialized -verify %s6 */7 8/* WG14 DR338: yes9 * C99 seems to exclude indeterminate value from being an uninitialized register10 *11 * Note, because we're relying on -Wuninitialized, this test has to live in its12 * own file. That analysis will not run if the file has other errors in it.13 */14int dr338(void) {15  unsigned char uc;   /* expected-note {{initialize the variable 'uc' to silence this warning}} */16  return uc + 1 >= 0; /* expected-warning {{variable 'uc' is uninitialized when used here}} */17}18