| 1 |
// RUN: %clang_cc1 -verify -w -fopenmp -x c++ -triple x86_64-unknown-linux -emit-llvm %s -fexceptions -fcxx-exceptions -o - -fsanitize-address-use-after-scope | FileCheck %s |
| 2 |
// expected-no-diagnostics |
| 3 |
|
| 4 |
#ifndef HEADER |
| 5 |
#define HEADER |
| 6 |
|
| 7 |
void bar(); |
| 8 |
|
| 9 |
void x86_64_device_isa_selected() { |
| 10 |
#pragma omp metadirective when(device = {isa("sse2")} \ |
| 11 |
: parallel) default(single) |
| 12 |
bar(); |
| 13 |
} |
| 14 |
// CHECK-LABEL: void @_Z26x86_64_device_isa_selectedv() |
| 15 |
// CHECK: ...) @__kmpc_fork_call{{.*}}@_Z26x86_64_device_isa_selectedv.omp_outlined |
| 16 |
// CHECK: ret void |
| 17 |
|
| 18 |
// CHECK: define internal void @_Z26x86_64_device_isa_selectedv.omp_outlined( |
| 19 |
// CHECK: @_Z3barv |
| 20 |
// CHECK: ret void |
| 21 |
|
| 22 |
void x86_64_device_isa_not_selected() { |
| 23 |
#pragma omp metadirective when(device = {isa("some-unsupported-feature")} \ |
| 24 |
: parallel) default(single) |
| 25 |
bar(); |
| 26 |
} |
| 27 |
// CHECK-LABEL: void @_Z30x86_64_device_isa_not_selectedv() |
| 28 |
// CHECK: call i32 @__kmpc_single |
| 29 |
// CHECK: @_Z3barv |
| 30 |
// CHECK: call void @__kmpc_end_single |
| 31 |
// CHECK: ret void |
| 32 |
#endif |