1*0a6a1f1dSLionel Sambuc // RUN: %clang_cc1 -emit-llvm %s -o - -fcuda-is-device -triple nvptx64-unknown-unknown | FileCheck %s 2*0a6a1f1dSLionel Sambuc 3*0a6a1f1dSLionel Sambuc 4*0a6a1f1dSLionel Sambuc // Make sure we emit the proper addrspacecast for llvm.used. PR22383 exposed an 5*0a6a1f1dSLionel Sambuc // issue where we were generating a bitcast instead of an addrspacecast. 6*0a6a1f1dSLionel Sambuc 7*0a6a1f1dSLionel Sambuc // 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" 8*0a6a1f1dSLionel Sambuc __attribute__((device)) __attribute__((__used__)) int a[] = {}; 9