aboutsummaryrefslogtreecommitdiff
path: root/clang/test/CodeGenCXX/weak-init.cpp
blob: d9b17d9ca74f87b249ee9743868d712f0fe2172f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
// RUN: %clang_cc1 -triple=x86_64-pc-linux-gnu -emit-llvm %s -o - | FileCheck %s
// RUN: %clang_cc1 -triple=x86_64-pc-linux-gnu -emit-llvm %s -o - -fexperimental-new-constant-interpreter | FileCheck %s

extern const int W __attribute__((weak)) = 99;
const int S = 77;

// CHECK: @C1 = {{.*}} 77
extern const int C1 = S;

// CHECK: %0 = load {{.*}} @W
// CHECK-NEXT: store {{.*}} %0, {{.*}} @C2
extern const int C2 = W;