1 ;; Make sure backend doesn't crash if the program contains
2 ;; a mangled function which is not an OpenCL bultin.
4 ;; void __attribute__((overloadable))
5 ;; foo(image2d_t srcImage);
7 ;; void bar(image2d_t srcImage) {
10 ;; clang -cc1 /work/tmp/tmp.cl -cl-std=CL2.0 -triple spir-unknown-unknown -finclude-default-header -emit-llvm -o test/mangled_function.ll
12 ; RUN: llc -O0 -mtriple=spirv32-unknown-unknown %s -o - | FileCheck %s --check-prefix=CHECK-SPIRV
14 ; CHECK-SPIRV: OpName %[[#foo:]] "_Z3foo14ocl_image2d_ro"
15 ; CHECK-SPIRV: %[[#foo]] = OpFunction %[[#]]
17 define spir_func void @bar(target("spirv.Image", void, 1, 0, 0, 0, 0, 0, 0) %srcImage) local_unnamed_addr {
18 tail call spir_func void @_Z3foo14ocl_image2d_ro(target("spirv.Image", void, 1, 0, 0, 0, 0, 0, 0) %srcImage)
22 declare spir_func void @_Z3foo14ocl_image2d_ro(target("spirv.Image", void, 1, 0, 0, 0, 0, 0, 0)) local_unnamed_addr