xref: /llvm-project/clang/test/CodeGen/PR3613-static-decl.c (revision 8fbe78f6fc7b41d1a4228c126fcb522131150518)
1*8fbe78f6SDaniel Dunbar // RUN: %clang_cc1 -triple i386-unknown-unknown -emit-llvm -o %t %s
272fb384aSAnders Carlsson // RUN: grep '@g0 = internal global %.truct.s0 { i32 3 }' %t | count 1
3b2f4cdb2SDaniel Dunbar 
4b2f4cdb2SDaniel Dunbar struct s0 {
5b2f4cdb2SDaniel Dunbar   int a;
6b2f4cdb2SDaniel Dunbar };
7b2f4cdb2SDaniel Dunbar 
8b2f4cdb2SDaniel Dunbar static struct s0 g0;
9b2f4cdb2SDaniel Dunbar 
f0(void)10b2f4cdb2SDaniel Dunbar static int f0(void) {
11b2f4cdb2SDaniel Dunbar   return g0.a;
12b2f4cdb2SDaniel Dunbar }
13b2f4cdb2SDaniel Dunbar 
14b2f4cdb2SDaniel Dunbar static struct s0 g0 = {3};
15b2f4cdb2SDaniel Dunbar 
16b2f4cdb2SDaniel Dunbar void *g1 = f0;
17