mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-26 15:56:07 +00:00

This change implements variable linkage types in ClangIR except for common linkage which requires Comdat support. --------- Co-authored-by: Morris Hafner <mhafner@nvidia.com> Co-authored-by: Henrich Lauko <xlauko@mail.muni.cz>
12 lines
366 B
C++
12 lines
366 B
C++
// Linkage types of global variables
|
|
// RUN: %clang_cc1 -std=c++20 -triple x86_64-unknown-linux-gnu -fclangir -emit-cir %s -o - | FileCheck %s
|
|
|
|
int aaaa;
|
|
// CHECK: cir.global external @aaaa
|
|
static int bbbb;
|
|
// CHECK: cir.global internal @bbbb
|
|
inline int cccc;
|
|
// CHECK: cir.global linkonce_odr @cccc
|
|
[[gnu::selectany]] int dddd;
|
|
// CHECK: cir.global weak_odr @dddd
|