
This patch makes the final major change of the RemoveDIs project, changing the default IR output from debug intrinsics to debug records. This is expected to break a large number of tests: every single one that tests for uses or declarations of debug intrinsics and does not explicitly disable writing records. If this patch has broken your downstream tests (or upstream tests on a configuration I wasn't able to run): 1. If you need to immediately unblock a build, pass `--write-experimental-debuginfo=false` to LLVM's option processing for all failing tests (remember to use `-mllvm` for clang/flang to forward arguments to LLVM). 2. For most test failures, the changes are trivial and mechanical, enough that they can be done by script; see the migration guide for a guide on how to do this: https://llvm.org/docs/RemoveDIsDebugInfo.html#test-updates 3. If any tests fail for reasons other than FileCheck check lines that need updating, such as assertion failures, that is most likely a real bug with this patch and should be reported as such. For more information, see the recent PSA: https://discourse.llvm.org/t/psa-ir-output-changing-from-debug-intrinsics-to-debug-records/79578
60 lines
2.1 KiB
C
60 lines
2.1 KiB
C
// This testcase checks emission of debug info for threadprivate variables
|
|
// present in any clause of OpenMP construct.
|
|
|
|
// REQUIRES: x86-registered-target
|
|
|
|
// RUN: %clang_cc1 -debug-info-kind=constructor -x c -verify -triple x86_64-pc-linux-gnu -fopenmp -emit-llvm %s -o - | FileCheck %s
|
|
// expected-no-diagnostics
|
|
|
|
// CHECK: define internal void @main.omp_outlined_debug__(
|
|
// CHECK: #dbg_declare(ptr %.global_tid..addr,
|
|
// CHECK: #dbg_declare(ptr %.bound_tid..addr,
|
|
// CHECK: #dbg_declare(ptr %nt.addr
|
|
// CHECK: store ptr %gbl_dynamic_int, ptr %gbl_dynamic_int.addr, align 8
|
|
// CHECK-NOT: #dbg_declare(ptr %gbl_dynamic_int.addr
|
|
// CHECK-NOT: #dbg_declare(ptr %gbl_static_int.addr
|
|
|
|
extern int printf(const char *, ...);
|
|
extern void omp_set_num_threads(int);
|
|
extern int omp_get_num_threads(void);
|
|
extern int omp_get_thread_num(void);
|
|
|
|
int gbl_dynamic_int;
|
|
__thread int gbl_static_int;
|
|
|
|
#pragma omp threadprivate(gbl_dynamic_int)
|
|
|
|
int main() {
|
|
int nt = 0;
|
|
int offset = 10;
|
|
gbl_dynamic_int = 55;
|
|
gbl_static_int = 77;
|
|
|
|
omp_set_num_threads(4);
|
|
#pragma omp parallel copyin(gbl_dynamic_int, gbl_static_int)
|
|
{
|
|
int data;
|
|
int tid;
|
|
nt = omp_get_num_threads();
|
|
tid = omp_get_thread_num();
|
|
data = gbl_dynamic_int + gbl_static_int;
|
|
gbl_dynamic_int += 10;
|
|
gbl_static_int += 20;
|
|
#pragma omp barrier
|
|
if (tid == 0)
|
|
printf("In parallel region total threads = %d, thread id = %d data=%d gbl_dyn_addr = %p, gbl_static_addr = %p\n",
|
|
nt, tid, data, &gbl_dynamic_int, &gbl_static_int);
|
|
if (tid == 1)
|
|
printf("In parallel region total threads = %d, thread id = %d data=%d gbl_dyn_addr = %p, gbl_static_addr = %p\n",
|
|
nt, tid, data, &gbl_dynamic_int, &gbl_static_int);
|
|
if (tid == 2)
|
|
printf("In parallel region total threads = %d, thread id = %d data=%d gbl_dyn_addr = %p, gbl_static_addr = %p\n",
|
|
nt, tid, data, &gbl_dynamic_int, &gbl_static_int);
|
|
if (tid == 3)
|
|
printf("In parallel region total threads = %d, thread id = %d data=%d gbl_dyn_addr = %p, gbl_static_addr = %p\n",
|
|
nt, tid, data, &gbl_dynamic_int, &gbl_static_int);
|
|
}
|
|
|
|
return 0;
|
|
}
|