blob: 22c620aa642984007fa8396451fdf1e2092082e5 [file] [log] [blame]
Stephen Hines0e2c34f2015-03-23 12:09:02 -07001// RUN: %clang_cc1 %s -emit-llvm -o - | FileCheck %s
2
3int c[1][3*2];
4// CHECK: @{{.+}} = {{.*}} global [1 x [6 x {{i[0-9]+}}]] zeroinitializer
5
6// CHECK-LABEL: @f
7int f(int * const m, int (**v)[*m * 2])
8{
9 return &(c[0][*m]) == &((*v)[0][*m]);
10 // CHECK: icmp
11 // CHECK: ret i{{[0-9]+}}
12}
13
14// CHECK-LABEL: @test
15int test(int n, int (*(*fn)(void))[n]) {
16 return (*fn())[0];
17}
18
19// CHECK-LABEL: @main
20int main()
21{
22 int m = 3;
23 int (*d)[3*2] = c;
24 int (*fn[m])(void);
25 return f(&m, &d) + test(m, &fn);
26
27 // CHECK: call {{.+}} @f(
28 // CHECK: ret i{{[0-9]+}}
29}
30