Timm Baeder 97aa8cc94d
[clang][bytecode] Diagnose weak reads in final load (#109515)
They aren't allowed here either.
2024-09-21 09:10:31 +02:00

13 lines
419 B
C++

// 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;