brintos

brintos / llvm-project-archived public Read only

0
0
Text · 991 B · bc27d2f Raw
30 lines · plain
1// REQUIRES: x86-registered-target2// REQUIRES: nvptx-registered-target3// REQUIRES: amdgpu-registered-target4 5// RUN: %clang_cc1 -fcuda-is-device -triple nvptx-nvidia-cuda -emit-llvm \6// RUN:   -o - %s | FileCheck %s7// RUN: %clang_cc1 -fcuda-is-device -triple nvptx-nvidia-cuda -emit-llvm -target-sdk-version=10.1 \8// RUN:   -o - %s | FileCheck %s9// RUN: %clang_cc1 -fcuda-is-device -triple amdgcn-amd-amdhsa -emit-llvm \10// RUN:   -o - %s | FileCheck %s11 12#include "Inputs/cuda.h"13 14extern "C" {15__device__ int foo() { return 1; }16}17 18[[gnu::alias("foo")]] __device__ int alias();19 20// CHECK: @_Z5aliasv = alias i32 (), ptr @foo21//22//      CHECK: define dso_local i32 @foo() #[[ATTR0:[0-9]+]] {23// CHECK-NEXT: entry:24//      CHECK:   ret i32 125// CHECK-NEXT: }26 27// RUN: not %clang_cc1 -fcuda-is-device -triple nvptx-nvidia-cuda -emit-llvm -target-sdk-version=9.0 \28// RUN:   -o - %s 2>&1 | FileCheck %s --check-prefix=NO_SUPPORT29// NO_SUPPORT: CUDA older than 10.0 does not support .alias30