xref: /llvm-project/clang/test/OpenMP/declare_variant_bind_to_decl.cpp (revision f892ddb3be640f477fc9acef55e7bd613fc27acf)
1 // NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py UTC_ARGS: --function-signature --include-generated-funcs
2 // RUN: %clang_cc1 -verify -fopenmp -x c++ -triple powerpc64le-unknown-unknown -emit-llvm %s -o - | FileCheck %s
3 // expected-no-diagnostics
4 
5 #ifndef HEADER
6 #define HEADER
7 
foo()8 void foo() { }
9 
10 #pragma omp begin declare variant match( \
11     device = {arch(ppc64le, ppc64)},     \
12     implementation = {extension(match_any, bind_to_declaration)})
13 
14 void foo();
15 
16 #pragma omp end declare variant
17 
main()18 int main() {
19   foo();
20 }
21 
22 #endif
23 // CHECK-LABEL: define {{[^@]+}}@_Z3foov
24 // CHECK-SAME: () #[[ATTR0:[0-9]+]] {
25 // CHECK-NEXT:  entry:
26 // CHECK-NEXT:    ret void
27 //
28 //
29 // CHECK-LABEL: define {{[^@]+}}@main
30 // CHECK-SAME: () #[[ATTR1:[0-9]+]] {
31 // CHECK-NEXT:  entry:
32 // CHECK-NEXT:    call void @"_Z74foo$ompvariant$S2$s7$Pppc64le$Pppc64$S3$s9$Pmatch_any$Pbind_to_declarationv"()
33 // CHECK-NEXT:    ret i32 0
34 //
35