Clang Project

clang_source_code/test/SemaCUDA/alias.cu
1// RUN: %clang_cc1 -triple nvptx-unknown-cuda -fsyntax-only -fcuda-is-device -verify -DEXPECT_ERR %s
2// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -fsyntax-only -verify %s
3
4// The alias attribute is not allowed in CUDA device code.
5void bar();
6__attribute__((alias("bar"))) void foo();
7#ifdef EXPECT_ERR
8// expected-error@-2 {{CUDA does not support aliases}}
9#else
10// expected-no-diagnostics
11#endif
12