1 // RUN: %clang_cc1 -verify -analyze -analyzer-experimental-internal-checks -analyzer-check-objc-mem -analyzer-store=basic %s
3 struct tea_cheese
{ unsigned magic
; };
4 typedef struct tea_cheese kernel_tea_cheese_t
;
5 extern kernel_tea_cheese_t _wonky_gesticulate_cheese
;
7 // This test case exercises the ElementRegion::getRValueType() logic.
8 // All it tests is that it does not crash or do anything weird.
9 // The out-of-bounds-access on line 19 is caught using the region store variant.
13 kernel_tea_cheese_t
*wonky
= &_wonky_gesticulate_cheese
;
14 struct load_wine
*cmd
= (void*) &wonky
[1];
16 char *p
= (void*) &wonky
[1];
18 kernel_tea_cheese_t
*q
= &wonky
[1];
19 kernel_tea_cheese_t r
= *q
; // no-warning