llvm-project/clang/test/CIR/global-var-linkage.cpp
Morris Hafner 710de09f17
[CIR] Upstream global variable linkage types (#129072)
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>
2025-03-06 10:17:58 -08:00

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