brintos

brintos / llvm-project-archived public Read only

0
0
Text · 895 B · c5205b2 Raw
35 lines · plain
1// RUN: %clang_analyze_cc1 -analyzer-checker=core,alpha.core -analyzer-disable-checker=alpha.core.PointerArithm %s -verify2// expected-no-diagnostics3 4typedef int bar_return_t;5typedef struct {6  unsigned char int_rep;7} Foo_record_t;8extern Foo_record_t Foo_record;9struct QuxSize {};10typedef struct QuxSize QuxSize;11typedef struct {12  Foo_record_t Foo;13  QuxSize size[0];14} __Request__SetPortalSize_t;15 16double __Foo_READSWAP__double(double*);17 18static __inline__ bar_return_t19__Beeble_check__Request__SetPortalSize_t(__Request__SetPortalSize_t *In0P) {20  if (In0P->Foo.int_rep != Foo_record.int_rep) {21    do {22      int __i__, __C__ = (2);23      for (__i__ = 0;24           __i__ < __C__;25           __i__++) do {26        *(&((double *)(&In0P->size))[__i__]) =27          __Foo_READSWAP__double(&((double *)(&In0P->size))[__i__]);28      }29      while (0);30    }31    while (0);32  }33  return 0;34}35