llvm-project/clang/test/CodeGenSYCL/address-space-mangling.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

31 lines
1.2 KiB
C++

// RUN: %clang_cc1 -no-opaque-pointers -triple spir64 -fsycl-is-device -disable-llvm-passes -emit-llvm %s -o - | FileCheck %s --check-prefix=SPIR
// RUN: %clang_cc1 -no-opaque-pointers -triple x86_64 -fsycl-is-device -disable-llvm-passes -emit-llvm %s -o - | FileCheck %s --check-prefix=X86
// REQUIRES: x86-registered-target
void foo(__attribute__((opencl_global)) int *);
void foo(__attribute__((opencl_local)) int *);
void foo(__attribute__((opencl_private)) int *);
void foo(int *);
// SPIR: declare spir_func void @_Z3fooPU3AS1i(i32 addrspace(1)* noundef) #1
// SPIR: declare spir_func void @_Z3fooPU3AS3i(i32 addrspace(3)* noundef) #1
// SPIR: declare spir_func void @_Z3fooPU3AS0i(i32* noundef) #1
// SPIR: declare spir_func void @_Z3fooPi(i32 addrspace(4)* noundef) #1
// X86: declare void @_Z3fooPU8SYglobali(i32* noundef) #1
// X86: declare void @_Z3fooPU7SYlocali(i32* noundef) #1
// X86: declare void @_Z3fooPU9SYprivatei(i32* noundef) #1
// X86: declare void @_Z3fooPi(i32* noundef) #1
void test() {
__attribute__((opencl_global)) int *glob;
__attribute__((opencl_local)) int *loc;
__attribute__((opencl_private)) int *priv;
int *def;
foo(glob);
foo(loc);
foo(priv);
foo(def);
}