brintos

brintos / llvm-project-archived public Read only

0
0
Text · 962 B · 457e6e7 Raw
23 lines · plain
1// REQUIRES: x86-registered-target2// REQUIRES: nvptx-registered-target3 4// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -emit-llvm -o - %s | \5// RUN:  FileCheck --check-prefixes=HOST,BOTH %s6// RUN: %clang_cc1 -fcuda-is-device -triple nvptx64-nvidia-cuda \7// RUN:   -emit-llvm -o - %s | FileCheck %s --check-prefixes=DEVICE,BOTH8 9// BOTH-LABEL: define{{.*}} float @logf(float10 11// logf() should be calling itself recursively as we don't have any standard12// library on device side.13// DEVICE: call contract float @logf(float14extern "C" __attribute__((device)) float logf(float __x) { return logf(__x); }15 16// NOTE: this case is to illustrate the expected differences in behavior between17// the host and device. In general we do not mess with host-side standard18// library.19//20// Host is assumed to have standard library, so logf() calls LLVM intrinsic.21// HOST: call contract float @llvm.log.f32(float22extern "C" float logf(float __x) { return logf(__x); }23