brintos

brintos / llvm-project-archived public Read only

0
0
Text · 871 B · 9453f15 Raw
39 lines · c
1// RUN: %clang_cc1 -emit-llvm -w -o - %s | FileCheck %s2 3// CHECK-DAG: @r = {{(dso_local )?}}global [1 x {{.*}}] zeroinitializer4 5int r[];6int (*a)[] = &r;7 8struct s0;9struct s0 x;10// CHECK-DAG: @x = {{(dso_local )?}}global %struct.s0 zeroinitializer11 12struct s0 y;13// CHECK-DAG: @y = {{(dso_local )?}}global %struct.s0 zeroinitializer14struct s0 *f0(void) {15  return &y;16}17 18struct s0 {19  int x;20};21 22// CHECK-DAG: @b = {{(dso_local )?}}global [1 x {{.*}}] zeroinitializer23int b[];24int *f1(void) {25  return b;26}27 28// Check that the most recent tentative definition wins.29// CHECK-DAG: @c = {{(dso_local )?}}global [4 x {{.*}}] zeroinitializer30int c[];31int c[4];32 33// Check that we emit static tentative definitions34// CHECK-DAG: @c5 = internal global [1 x {{.*}}] zeroinitializer35static int c5[];36static int func(void) { return c5[0]; }37int callfunc(void) { return func(); }38 39