xref: /llvm-project/clang/test/CodeGen/static-order.c (revision 12f78e740c5419f7d1fbcf8f2106e7a40cd1d6f7)
1 // RUN: %clang_cc1 -emit-llvm -o - %s | FileCheck %s
2 // CHECK: ModuleID
3 // CHECK-NOT: zeroinitializer
4 // CHECK-LABEL: define {{.*}}ptr @f
5 
6 struct s {
7     int a;
8 };
9 
10 static void *v;
11 
12 static struct s a;
13 
14 static struct s a = {
15     10
16 };
17 
18 void *f(void)
19 {
20   if (a.a)
21     return v;
22   return 0;
23 }
24