aboutsummaryrefslogtreecommitdiff
path: root/clang/test/CodeGen/LoongArch/tls-dialect.c
blob: 03401ef8af03d45ffc82b22ed5f5213adf8df0d2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
// REQUIRES: loongarch-registered-target
/// cc1 -enable-tlsdesc (due to -mtls-dialect=desc) enables TLSDESC.
// RUN: %clang_cc1 -triple loongarch64 -S -mrelocation-model pic -pic-level 1 -enable-tlsdesc %s -o - | FileCheck %s --check-prefix=DESC
// RUN: %clang_cc1 -triple loongarch64 -S -mrelocation-model pic -pic-level 1 %s -o - | FileCheck %s --check-prefix=NODESC

__thread int x;

// DESC:       %desc_pc_hi20
// DESC-NOT:   %gd_pc_hi20
// NODESC:     %gd_pc_hi20
// NODESC-NOT: %desc_pc_hi20
int use() {
  return x;
}