Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / clang / test / OpenMP / metadirective_device_isa_codegen.cpp
blob1d098063101d7ea4e7c1c713eceba3a415dc1a04
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
4 #ifndef HEADER
5 #define HEADER
7 void bar();
9 void x86_64_device_isa_selected() {
10 #pragma omp metadirective when(device = {isa("sse2")} \
11 : parallel) default(single)
12 bar();
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
18 // CHECK: define internal void @_Z26x86_64_device_isa_selectedv.omp_outlined(
19 // CHECK: @_Z3barv
20 // CHECK: ret void
22 void x86_64_device_isa_not_selected() {
23 #pragma omp metadirective when(device = {isa("some-unsupported-feature")} \
24 : parallel) default(single)
25 bar();
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