blob: e166fb44659d3daf679f096c85282a685da1882a [file] [log] [blame]
Shih-wei Liaof8fd82b2010-02-10 11:10:31 -08001// RUN: %clang_cc1 -emit-llvm -o - -triple i386-linux-gnu %s | FileCheck %s
2
3// This checks that the global won't be marked as common.
4// (It shouldn't because it's being initialized).
5
6int a;
7int a = 242;
8// CHECK: @a = global i32 242
9
10// This should get normal weak linkage.
11int c __attribute__((weak))= 0;
12// CHECK: @c = weak global i32 0
13
14
15
16// Since this is marked const, it should get weak_odr linkage, since all
17// definitions have to be the same.
18// CHECK: @d = weak_odr constant i32 0
19const int d __attribute__((weak))= 0;
20
21
22
23// NOTE: tentative definitions are processed at the end of the translation unit.
24
25// This shouldn't be emitted as common because it has an explicit section.
26// rdar://7119244
27int b __attribute__((section("foo")));
28
29// CHECK: @b = global i32 0, section "foo"
30