1 // NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py UTC_ARGS: --function-signature --include-generated-funcs --replace-value-regex "__omp_offloading_[0-9a-z]+_[0-9a-z]+" "reduction_size[.].+[.]" "pl_cond[.].+[.|,]" --prefix-filecheck-ir-name _
2 // RUN: %clang_cc1 -verify -fopenmp -x c++ -triple x86_64-pc-windows-msvc18.0.0 -std=c++11 -fms-compatibility-version=18 -fms-extensions -emit-llvm %s -fexceptions -fcxx-exceptions -o - | FileCheck %s --check-prefix=CHECK1
4 // RUN: %clang_cc1 -verify -fopenmp-simd -x c++ -triple x86_64-pc-windows-msvc18.0.0 -std=c++11 -fms-compatibility-version=18 -fms-extensions -emit-llvm %s -fexceptions -fcxx-exceptions -o - | FileCheck %s --implicit-check-not="{{__kmpc|__tgt}}"
6 // expected-no-diagnostics
19 #pragma omp single copyprivate(local_j)
24 // Assure reports a data race, but value written to "j"
25 // should always be the same.
48 // CHECK1-LABEL: define {{[^@]+}}@main
49 // CHECK1-SAME: () #[[ATTR0:[0-9]+]] {
50 // CHECK1-NEXT: entry:
51 // CHECK1-NEXT: [[RETVAL:%.*]] = alloca i32, align 4
52 // CHECK1-NEXT: store i32 0, ptr [[RETVAL]], align 4
53 // CHECK1-NEXT: call void @"?main@Test@@SAXXZ"()
54 // CHECK1-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr @[[GLOB1:[0-9]+]], i32 0, ptr @main.omp_outlined)
55 // CHECK1-NEXT: ret i32 0
58 // CHECK1-LABEL: define {{[^@]+}}@main.omp_outlined
59 // CHECK1-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]]) #[[ATTR2:[0-9]+]] personality ptr @__CxxFrameHandler3 {
60 // CHECK1-NEXT: entry:
61 // CHECK1-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
62 // CHECK1-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
63 // CHECK1-NEXT: [[T:%.*]] = alloca i32, align 4
64 // CHECK1-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
65 // CHECK1-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
66 // CHECK1-NEXT: invoke void @"?foo@@YAXXZ"()
67 // CHECK1-NEXT: to label [[INVOKE_CONT:%.*]] unwind label [[CATCH_DISPATCH:%.*]]
68 // CHECK1: catch.dispatch:
69 // CHECK1-NEXT: [[TMP0:%.*]] = catchswitch within none [label %catch] unwind label [[TERMINATE:%.*]]
71 // CHECK1-NEXT: [[TMP1:%.*]] = catchpad within [[TMP0]] [ptr @"??_R0H@8", i32 0, ptr %t]
72 // CHECK1-NEXT: [[TMP2:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
73 // CHECK1-NEXT: [[TMP3:%.*]] = load i32, ptr [[TMP2]], align 4
74 // CHECK1-NEXT: call void @__kmpc_critical(ptr @[[GLOB1]], i32 [[TMP3]], ptr @.gomp_critical_user_.var) [ "funclet"(token [[TMP1]]) ]
75 // CHECK1-NEXT: invoke void @"?bar@@YAXXZ"() [ "funclet"(token [[TMP1]]) ]
76 // CHECK1-NEXT: to label [[INVOKE_CONT1:%.*]] unwind label [[TERMINATE2:%.*]]
77 // CHECK1: invoke.cont1:
78 // CHECK1-NEXT: call void @__kmpc_end_critical(ptr @[[GLOB1]], i32 [[TMP3]], ptr @.gomp_critical_user_.var) [ "funclet"(token [[TMP1]]) ]
79 // CHECK1-NEXT: catchret from [[TMP1]] to label [[CATCHRET_DEST:%.*]]
80 // CHECK1: catchret.dest:
81 // CHECK1-NEXT: br label [[TRY_CONT:%.*]]
83 // CHECK1-NEXT: ret void
84 // CHECK1: invoke.cont:
85 // CHECK1-NEXT: br label [[TRY_CONT]]
87 // CHECK1-NEXT: [[TMP4:%.*]] = cleanuppad within none []
88 // CHECK1-NEXT: call void @"?terminate@@YAXXZ"() #[[ATTR7:[0-9]+]] [ "funclet"(token [[TMP4]]) ]
89 // CHECK1-NEXT: unreachable
90 // CHECK1: terminate2:
91 // CHECK1-NEXT: [[TMP5:%.*]] = cleanuppad within [[TMP1]] []
92 // CHECK1-NEXT: call void @"?terminate@@YAXXZ"() #[[ATTR7]] [ "funclet"(token [[TMP5]]) ]
93 // CHECK1-NEXT: unreachable
96 // CHECK1-LABEL: define {{[^@]+}}@.omp.copyprivate.copy_func
97 // CHECK1-SAME: (ptr noundef [[TMP0:%.*]], ptr noundef [[TMP1:%.*]]) #[[ATTR6:[0-9]+]] {
98 // CHECK1-NEXT: entry:
99 // CHECK1-NEXT: [[DOTADDR:%.*]] = alloca ptr, align 8
100 // CHECK1-NEXT: [[DOTADDR1:%.*]] = alloca ptr, align 8
101 // CHECK1-NEXT: store ptr [[TMP1]], ptr [[DOTADDR]], align 8
102 // CHECK1-NEXT: store ptr [[TMP0]], ptr [[DOTADDR1]], align 8
103 // CHECK1-NEXT: [[TMP2:%.*]] = load ptr, ptr [[DOTADDR1]], align 8
104 // CHECK1-NEXT: [[TMP3:%.*]] = load ptr, ptr [[DOTADDR]], align 8
105 // CHECK1-NEXT: [[TMP4:%.*]] = getelementptr inbounds [1 x ptr], ptr [[TMP2]], i64 0, i64 0
106 // CHECK1-NEXT: [[TMP5:%.*]] = load ptr, ptr [[TMP4]], align 8
107 // CHECK1-NEXT: [[TMP6:%.*]] = getelementptr inbounds [1 x ptr], ptr [[TMP3]], i64 0, i64 0
108 // CHECK1-NEXT: [[TMP7:%.*]] = load ptr, ptr [[TMP6]], align 8
109 // CHECK1-NEXT: [[TMP8:%.*]] = load i32, ptr [[TMP7]], align 4
110 // CHECK1-NEXT: store i32 [[TMP8]], ptr [[TMP5]], align 4
111 // CHECK1-NEXT: ret void