[clang] Implement lifetime analysis for lifetime_capture_by(X) (#115921)
[llvm-project.git] / clang / test / CodeGen / vlt_to_pointer.c
blobf06a1607ef469493d75d5486e6aff0ed4ff0c59e
1 // RUN: %clang_cc1 %s -emit-llvm -o - | FileCheck %s
3 int c[1][3*2];
4 // CHECK: @{{.+}} ={{.*}}global [1 x [6 x {{i[0-9]+}}]] zeroinitializer
6 // CHECK-LABEL: @f
7 int f(int * const m, int (**v)[*m * 2])
9 return &(c[0][*m]) == &((*v)[0][*m]);
10 // CHECK: icmp
11 // CHECK: ret i{{[0-9]+}}
14 // CHECK-LABEL: @test
15 int test(int n, int (*(*fn)(void))[n]) {
16 return (*fn())[0];
19 // CHECK-LABEL: @main
20 int main(void)
22 int m = 3;
23 int (*d)[3*2] = c;
24 int (*fn[m])(void);
25 return f(&m, &d) + test(m, &fn);
27 // CHECK: call {{.+}} @f(
28 // CHECK: ret i{{[0-9]+}}