mirror of
https://github.com/Gericom/teak-llvm.git
synced 2025-06-19 11:35:51 -04:00

Summary: This is especially important for targets that use multiple address spaces, and commonly place global variables in address spaces other than zero. Fixes PR22383 Test Plan: New test case added: llvm-used.cu Reviewers: jingyue Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D7345 llvm-svn: 227861
9 lines
501 B
Plaintext
9 lines
501 B
Plaintext
// 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[] = {};
|