diff options
| author | Dimitry Andric <dim@FreeBSD.org> | 2015-02-14 12:18:48 +0000 |
|---|---|---|
| committer | Dimitry Andric <dim@FreeBSD.org> | 2015-02-14 12:18:48 +0000 |
| commit | ec12bbe359799efc32df6bde5e872cb2713c0b19 (patch) | |
| tree | dfd4e4f0fa9ce6e010e098662d5f00a37c9ff0e3 /test/CodeGenCUDA | |
| parent | 9e435806aaf5bd7e974d317ef247f200200ad686 (diff) | |
Notes
Diffstat (limited to 'test/CodeGenCUDA')
| -rw-r--r-- | test/CodeGenCUDA/llvm-used.cu | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/test/CodeGenCUDA/llvm-used.cu b/test/CodeGenCUDA/llvm-used.cu new file mode 100644 index 000000000000..44666a91c3bb --- /dev/null +++ b/test/CodeGenCUDA/llvm-used.cu @@ -0,0 +1,8 @@ +// RUN: %clang_cc1 -emit-llvm %s -o - -fcuda-is-device -triple nvptx64-unknown-unknown | FileCheck %s + + +// Make sure we emit the proper addrspacecast for llvm.used. PR22383 exposed an +// issue where we were generating a bitcast instead of an addrspacecast. + +// CHECK: @llvm.used = appending global [1 x i8*] [i8* addrspacecast (i8 addrspace(1)* bitcast ([0 x i32] addrspace(1)* @a to i8 addrspace(1)*) to i8*)], section "llvm.metadata" +__attribute__((device)) __attribute__((__used__)) int a[] = {}; |
