xref: /minix3/external/bsd/llvm/dist/clang/test/CodeGen/linkage-redecl.c (revision f4a2713ac843a11c696ec80c0a5e3e5d80b4d338)
1*f4a2713aSLionel Sambuc // RUN: %clang_cc1 -emit-llvm %s -o - | FileCheck %s
2*f4a2713aSLionel Sambuc 
3*f4a2713aSLionel Sambuc // CHECK: @test2_i = internal global i32 99
4*f4a2713aSLionel Sambuc static int test2_i = 99;
test2_f()5*f4a2713aSLionel Sambuc int test2_f() {
6*f4a2713aSLionel Sambuc   extern int test2_i;
7*f4a2713aSLionel Sambuc   return test2_i;
8*f4a2713aSLionel Sambuc }
9*f4a2713aSLionel Sambuc 
10*f4a2713aSLionel Sambuc // C99 6.2.2p3
11*f4a2713aSLionel Sambuc // PR3425
12*f4a2713aSLionel Sambuc static void f(int x);
13*f4a2713aSLionel Sambuc 
g0()14*f4a2713aSLionel Sambuc void g0() {
15*f4a2713aSLionel Sambuc   f(5);
16*f4a2713aSLionel Sambuc }
17*f4a2713aSLionel Sambuc 
f(int x)18*f4a2713aSLionel Sambuc extern void f(int x) { } // still has internal linkage
19*f4a2713aSLionel Sambuc // CHECK-LABEL: define internal void @f
20