brintos

brintos / llvm-project-archived public Read only

0
0
Text · 690 B · f9c32f3 Raw
29 lines · plain
1// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu \2// RUN:   -fopenmp -emit-llvm -o -  -x hip %s | FileCheck %s3 4#include "Inputs/cuda.h"5 6void foo(double) {}7__device__ void foo(int) {}8 9// Check foo resolves to the host function.10// CHECK-LABEL: define {{.*}}@_Z5test1v11// CHECK: call void @_Z3food(double noundef 1.000000e+00)12void test1() {13  #pragma omp parallel14  for (int i = 0; i < 100; i++)15    foo(1);16}17 18// Check foo resolves to the host function.19// CHECK-LABEL: define {{.*}}@_Z5test2v20// CHECK: call void @_Z3food(double noundef 1.000000e+00)21void test2() {22  auto Lambda = []() {23    #pragma omp parallel24    for (int i = 0; i < 100; i++)25      foo(1);26  };27  Lambda();28}29