brintos

brintos / llvm-project-archived public Read only

0
0
Text · 881 B · 7c1a9a2 Raw
27 lines · c
1// RUN: %clang_cc1 -fsyntax-only -verify %s2 3typedef int Arr[10];4 5typedef int trungl_int;6 7void f(int a[10], Arr arr) { // expected-note 4 {{declared here}}8 9  /* Should warn. */10  (void)sizeof(a);  // \11      // expected-warning{{sizeof on array function parameter will return size of 'int *' instead of 'int[10]'}}12  (void)sizeof((((a))));  // \13      // expected-warning{{sizeof on array function parameter will return size of 'int *' instead of 'int[10]'}}14  (void)sizeof a;  // \15      // expected-warning{{sizeof on array function parameter will return size of 'int *' instead of 'int[10]'}}16  (void)sizeof arr;  // \17      // expected-warning{{sizeof on array function parameter will return size of 'int *' instead of 'Arr' (aka 'int[10]')}}18 19  /* Shouldn't warn. */20  int b[10];21  (void)sizeof b;22  Arr brr;23  (void)sizeof brr;24  (void)sizeof(Arr);25  (void)sizeof(int);26}27