1 // RUN: %clang_cc1 -verify -fopenmp -x c++ -triple x86_64-unknown-linux -emit-llvm %s -fexceptions -fcxx-exceptions -o - -fsanitize-address-use-after-scope | FileCheck %s
2 // RUN: %clang_cc1 -verify -fopenmp -x c++ -triple aarch64-unknown-linux -emit-llvm %s -fexceptions -fcxx-exceptions -o - -fsanitize-address-use-after-scope | FileCheck %s
3 // RUN: %clang_cc1 -verify -fopenmp -x c++ -triple ppc64le-unknown-linux -emit-llvm %s -fexceptions -fcxx-exceptions -o - -fsanitize-address-use-after-scope | FileCheck %s
5 // expected-no-diagnostics
12 #pragma omp metadirective when(device = {kind(any)} \
15 #pragma omp metadirective when(device = {kind(host, cpu)} \
16 : parallel for num_threads(4))
17 for (int i
= 0; i
< 100; i
++)
19 #pragma omp metadirective when(device = {kind(host)} \
21 for (int i
= 0; i
< 100; i
++)
23 #pragma omp metadirective when(device = {kind(nohost, gpu)} \
24 :) when(device = {kind(cpu)} \
27 #pragma omp metadirective when(device = {kind(any, cpu)} \
30 #pragma omp metadirective when(device = {kind(any, host)} \
33 #pragma omp metadirective when(device = {kind(gpu)} \
34 : target parallel for) default(parallel for)
35 for (int i
= 0; i
< 100; i
++)
39 // CHECK-LABEL: define {{.+}} void @_Z3foov()
40 // CHECK: @__kmpc_fork_call(ptr {{.+}}, i32 0, ptr [[OUTLINED_1:@.+]])
41 // CHECK-NEXT: @__kmpc_push_num_threads
42 // CHECK: @__kmpc_fork_call(ptr {{.+}}, i32 0, ptr [[OUTLINED_2:@.+]])
43 // CHECK: @__kmpc_fork_call(ptr {{.+}}, i32 0, ptr [[OUTLINED_3:@.+]])
44 // CHECK: @__kmpc_fork_call(ptr {{.+}}, i32 0, ptr [[OUTLINED_4:@.+]])
45 // CHECK: @__kmpc_fork_call(ptr {{.+}}, i32 0, ptr [[OUTLINED_5:@.+]])
46 // CHECK: @__kmpc_fork_call(ptr {{.+}}, i32 0, ptr [[OUTLINED_6:@.+]])
47 // CHECK: @__kmpc_fork_call(ptr {{.+}}, i32 0, ptr [[OUTLINED_7:@.+]])
50 // CHECK: define internal void [[OUTLINED_1]](
51 // CHECK: void @_Z3barv()
54 // CHECK: define internal void [[OUTLINED_2]](
55 // CHECK: call void @__kmpc_for_static_init
56 // CHECK: call void @__kmpc_for_static_fini
59 // CHECK: define internal void [[OUTLINED_3]](
60 // CHECK: call void @__kmpc_for_static_init
61 // CHECK: call void @__kmpc_for_static_fini
64 // CHECK: define internal void [[OUTLINED_4]](
65 // CHECK: void @_Z3barv()
68 // CHECK: define internal void [[OUTLINED_5]](
69 // CHECK: void @_Z3barv()
72 // CHECK: define internal void [[OUTLINED_6]](
73 // CHECK: void @_Z3barv()
76 // CHECK: define internal void [[OUTLINED_7]](
77 // CHECK: call void @__kmpc_for_static_init
78 // CHECK: call void @__kmpc_for_static_fini