26 lines · cpp
1// RUN: %clang_cc1 -triple x86_64-linux -emit-llvm -o - %s | FileCheck %s2 3__attribute__((section("A")))4const int a = 1;5const int *f() { return &a; }6// CHECK: @_ZL1a = internal constant i32 1, section "A"7 8int init();9__attribute__((section("B")))10const int b = init();11// Even if it's const-qualified, it must not be LLVM IR `constant` since it's12// dynamically initialised.13// CHECK: @_ZL1b = internal global i32 0, section "B"14 15__attribute__((section("C")))16int c = 2;17// CHECK: @c = {{.*}}global i32 2, section "C"18 19__attribute__((section("D")))20int d = init();21// CHECK: @d = {{.*}}global i32 0, section "D"22 23__attribute__((section("E")))24int e;25// CHECK: @e = {{.*}}global i32 0, section "E", align 426