llvm-project/clang/test/CodeGenSYCL/address-space-mangling.cpp
hyeongyu kim 1b1c8d83d3 [Clang/Test]: Rename enable_noundef_analysis to disable-noundef-analysis and turn it off by default
Turning on `enable_noundef_analysis` flag allows better codegen by removing freeze instructions.
I modified clang by renaming `enable_noundef_analysis` flag to `disable-noundef-analysis` and turning it off by default.

Test updates are made as a separate patch: D108453

Reviewed By: eugenis

Differential Revision: https://reviews.llvm.org/D105169
2022-01-16 18:54:17 +09:00

31 lines
1.1 KiB
C++

// RUN: %clang_cc1 -triple spir64 -fsycl-is-device -disable-llvm-passes -emit-llvm %s -o - | FileCheck %s --check-prefix=SPIR
// RUN: %clang_cc1 -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);
}