xref: /llvm-project/clang/test/CodeGenCUDA/llvm-used.cu (revision 0419465fa4358af1ec808e376e3881377bfac76b)
1 // RUN: %clang_cc1 -emit-llvm %s -o - -fcuda-is-device -triple nvptx64-unknown-unknown | FileCheck %s
2 
3 
4 // Make sure we emit the proper addrspacecast for llvm.used.  PR22383 exposed an
5 // issue where we were generating a bitcast instead of an addrspacecast.
6 
7 // CHECK: @llvm.compiler.used = appending global [1 x ptr] [ptr addrspacecast (ptr addrspace(1) @a to ptr)], section "llvm.metadata"
8 __attribute__((device)) __attribute__((__used__)) int a[] = {};
9