Clang Project

clang_source_code/test/CodeGenCUDA/alias.cu
1// REQUIRES: x86-registered-target
2// REQUIRES: nvptx-registered-target
3// REQUIRES: amdgpu-registered-target
4
5// RUN: %clang_cc1 -fcuda-is-device -triple nvptx-nvidia-cuda -emit-llvm \
6// RUN:   -o - %s | FileCheck %s
7// RUN: %clang_cc1 -fcuda-is-device -triple amdgcn -emit-llvm \
8// RUN:   -o - %s | FileCheck %s
9
10#include "Inputs/cuda.h"
11
12// Check that we don't generate an alias from "foo" to the mangled name for
13// ns::foo() -- nvptx doesn't support aliases.
14
15namespace ns {
16extern "C" {
17// CHECK-NOT: @foo = internal alias
18__device__ __attribute__((used)) static int foo() { return 0; }
19}
20}
21