1 // This testcase checks emission of DIFlagArtificial flag for outlined
2 // subroutines generated by compiler.
4 // REQUIRES: x86-registered-target
6 // RUN: %clang_cc1 -debug-info-kind=constructor -x c -verify -triple x86_64-pc-linux-gnu -fopenmp -emit-llvm %s -o - | FileCheck %s
7 // expected-no-diagnostics
10 #define __KAI_KMPC_CONVENTION __cdecl
12 #define __KAI_KMPC_CONVENTION
15 extern int printf(const char *, ...);
16 extern void __KAI_KMPC_CONVENTION
omp_set_num_threads(int);
17 extern int __KAI_KMPC_CONVENTION
omp_get_thread_num(void);
22 void foo_simd(int low
, int up
) {
23 for (int i
= low
; i
< up
; ++i
) {
25 #pragma omp ordered simd
33 omp_set_num_threads(2);
36 #pragma omp taskloop num_tasks(10)
37 for (i
= 0; i
< N
; i
++) {
41 for (int j
= 0; j
< N
; j
++) {
42 printf("%d\n", arr
[j
]);
47 // foo_simd is not artificial.
48 // CHECK-DAG: !DISubprogram(name: "foo_simd"
49 // CHECK-DAG-SAME: flags: DIFlagPrototyped,
51 // CHECK-DAG: !DISubprogram(name: "__captured_stmt_debug__"
52 // CHECK-DAG-SAME: flags: DIFlagArtificial
54 // CHECK-DAG: !DISubprogram(name: "__captured_stmt"
55 // CHECK-DAG-SAME: flags: DIFlagArtificial
57 // CHECK-DAG: !DISubprogram(name: "main.omp_outlined_debug__"
58 // CHECK-DAG-SAME: flags: DIFlagArtificial
60 // CHECK-DAG: !DISubprogram(linkageName: ".omp_task_entry."
61 // CHECK-DAG-SAME: flags: DIFlagArtificial
63 // CHECK-DAG: !DISubprogram(name: ".omp_outlined."
64 // CHECK-DAG-SAME: flags: DIFlagArtificial
66 // CHECK-DAG: !DISubprogram(name: "main.omp_outlined"
67 // CHECK-DAG-SAME: flags: DIFlagArtificial