brintos

brintos / llvm-project-archived public Read only

0
0
Text · 624 B · 7b9e60a Raw
31 lines · c
1// RUN: %clang_cc1 -Wno-error=incompatible-pointer-types %s -emit-llvm -o - | FileCheck %s2 3int c[1][3*2];4// CHECK: @{{.+}} ={{.*}}global [1 x [6 x {{i[0-9]+}}]] zeroinitializer5 6// CHECK-LABEL: @f7int f(int * const m, int (**v)[*m * 2])8{9    return &(c[0][*m]) == &((*v)[0][*m]);10    // CHECK: icmp11    // CHECK: ret i{{[0-9]+}}12}13 14// CHECK-LABEL: @test15int test(int n, int (*(*fn)(void))[n]) {16  return (*fn())[0];17}18 19// CHECK-LABEL: @main20int main(void)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 31