brintos

brintos / llvm-project-archived public Read only

0
0
Text · 858 B · 4993ea6 Raw
26 lines · c
1// RUN: %clang_cc1 -fsyntax-only -Wuninitialized -verify %s2// RUN: %clang_cc1 -fsyntax-only -Wuninitialized -fdiagnostics-parseable-fixits %s 2>&1 | FileCheck %s3 4_Bool test_bool_no_false(void) {5  _Bool var; // expected-note {{initialize}}6  // CHECK: fix-it:"{{.*}}":{[[@LINE-1]]:12-[[@LINE-1]]:12}:" = 0"7  return var; // expected-warning {{uninitialized}}8}9 10#define bool _Bool11#define false (bool)012#define true (bool)113bool test_bool_with_false(void) {14  bool var; // expected-note {{initialize}}15  // CHECK: fix-it:"{{.*}}":{[[@LINE-1]]:11-[[@LINE-1]]:11}:" = false"16  return var; // expected-warning {{uninitialized}}17}18 19bool test_bool_with_false_undefined(void) {20  bool21#undef false22      var; // expected-note {{initialize}}23  // CHECK: fix-it:"{{.*}}":{[[@LINE-1]]:10-[[@LINE-1]]:10}:" = 0"24  return var; // expected-warning {{uninitialized}}25}26