blob: c0e0d0ea785d71b4c5aae84acc99ba340a5b2d4b [file] [log] [blame]
Kaelyn Uhraind10f4bc2011-08-10 19:47:25 +00001// RUN: %clang_cc1 -verify -Warray-bounds-pointer-arithmetic %s
2
3// Test case from PR10615
4struct ext2_super_block{
5 unsigned char s_uuid[8]; // expected-note {{declared here}}
6};
7void* ext2_statfs (struct ext2_super_block *es,int a)
8{
9 return (void *)es->s_uuid + sizeof(int); // no-warning
10}
11void* broken (struct ext2_super_block *es,int a)
12{
13 return (void *)es->s_uuid + 80; // expected-warning {{refers past the end of the array}}
14}