[clang] Handle __declspec() attributes in using
[llvm-project.git] / clang / test / CodeGenCXX / amdgcn-string-literal.cpp
bloba26fc051882a4f5230ebf16de649a2f95d1de4a2
1 // RUN: %clang_cc1 -triple amdgcn-amd-amdhsa -emit-llvm %s -o - | FileCheck %s
3 // CHECK: @.str = private unnamed_addr addrspace(4) constant [6 x i8] c"g_str\00", align 1
4 // CHECK: @g_str ={{.*}} addrspace(1) global ptr addrspacecast (ptr addrspace(4) @.str to ptr), align 8
5 // CHECK: @g_array ={{.*}} addrspace(1) global [8 x i8] c"g_array\00", align 1
6 // CHECK: @.str.1 = private unnamed_addr addrspace(4) constant [6 x i8] c"l_str\00", align 1
7 // CHECK: @__const._Z1fv.l_array = private unnamed_addr addrspace(4) constant [8 x i8] c"l_array\00", align 1
9 const char* g_str = "g_str";
10 char g_array[] = "g_array";
12 void g(const char* p);
14 // CHECK-LABEL: define{{.*}} void @_Z1fv()
15 void f() {
16 const char* l_str = "l_str";
18 // CHECK: call void @llvm.memcpy.p0.p4.i64
19 char l_array[] = "l_array";
21 g(g_str);
22 g(g_array);
23 g(l_str);
24 g(l_array);
26 const char* p = g_str;
27 g(p);
30 // CHECK-LABEL: define{{.*}} void @_Z1ev
31 void e() {
32 g("string literal");
33 g("string literal");