| 1 |
// REQUIRES: x86-registered-target |
| 2 |
// REQUIRES: nvptx-registered-target |
| 3 |
|
| 4 |
// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -emit-llvm -o - %s | \ |
| 5 |
// RUN: FileCheck --check-prefixes=HOST,BOTH %s |
| 6 |
// RUN: %clang_cc1 -fcuda-is-device -triple nvptx64-nvidia-cuda \ |
| 7 |
// RUN: -emit-llvm -o - %s | FileCheck %s --check-prefixes=DEVICE,BOTH |
| 8 |
|
| 9 |
// BOTH-LABEL: define{{.*}} float @logf(float |
| 10 |
|
| 11 |
// logf() should be calling itself recursively as we don't have any standard |
| 12 |
// library on device side. |
| 13 |
// DEVICE: call contract float @logf(float |
| 14 |
extern "C" __attribute__((device)) float logf(float __x) { return logf(__x); } |
| 15 |
|
| 16 |
// NOTE: this case is to illustrate the expected differences in behavior between |
| 17 |
// the host and device. In general we do not mess with host-side standard |
| 18 |
// library. |
| 19 |
// |
| 20 |
// Host is assumed to have standard library, so logf() calls LLVM intrinsic. |
| 21 |
// HOST: call contract float @llvm.log.f32(float |
| 22 |
extern "C" float logf(float __x) { return logf(__x); } |