Files
clang-p2996/clang/test/CodeGenCXX/amdgcn-string-literal.cpp
Nikita Popov 532dc62b90 [OpaquePtrs][Clang] Add -no-opaque-pointers to tests (NFC)
This adds -no-opaque-pointers to clang tests whose output will
change when opaque pointers are enabled by default. This is
intended to be part of the migration approach described in
https://discourse.llvm.org/t/enabling-opaque-pointers-by-default/61322/9.

The patch has been produced by replacing %clang_cc1 with
%clang_cc1 -no-opaque-pointers for tests that fail with opaque
pointers enabled. Worth noting that this doesn't cover all tests,
there's a remaining ~40 tests not using %clang_cc1 that will need
a followup change.

Differential Revision: https://reviews.llvm.org/D123115
2022-04-07 12:09:47 +02:00

35 lines
1.1 KiB
C++

// RUN: %clang_cc1 -no-opaque-pointers -triple amdgcn-amd-amdhsa -emit-llvm %s -o - | FileCheck %s
// CHECK: @.str = private unnamed_addr addrspace(4) constant [6 x i8] c"g_str\00", align 1
// CHECK: @g_str ={{.*}} addrspace(1) global i8* addrspacecast (i8 addrspace(4)* getelementptr inbounds ([6 x i8], [6 x i8] addrspace(4)* @.str, i32 0, i32 0) to i8*), align 8
// CHECK: @g_array ={{.*}} addrspace(1) global [8 x i8] c"g_array\00", align 1
// CHECK: @.str.1 = private unnamed_addr addrspace(4) constant [6 x i8] c"l_str\00", align 1
// CHECK: @__const._Z1fv.l_array = private unnamed_addr addrspace(4) constant [8 x i8] c"l_array\00", align 1
const char* g_str = "g_str";
char g_array[] = "g_array";
void g(const char* p);
// CHECK-LABEL: define{{.*}} void @_Z1fv()
void f() {
const char* l_str = "l_str";
// CHECK: call void @llvm.memcpy.p0i8.p4i8.i64
char l_array[] = "l_array";
g(g_str);
g(g_array);
g(l_str);
g(l_array);
const char* p = g_str;
g(p);
}
// CHECK-LABEL: define{{.*}} void @_Z1ev
void e() {
g("string literal");
g("string literal");
}