• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; RUN: llvm-as %s -o %t.bc
2; RUN: llvm-spirv %t.bc -spirv-text -o %t.txt
3; RUN: FileCheck < %t.txt %s --check-prefix=CHECK-SPIRV
4; RUN: llvm-spirv %t.bc -o %t.spv
5; RUN: llvm-spirv -r %t.spv -o %t.rev.bc
6; RUN: llvm-dis < %t.rev.bc | FileCheck %s --check-prefix=CHECK-LLVM
7
8; CHECK-LLVM: ret i1 true
9
10; CHECK-SPIRV: 3 ConstantTrue
11
12target datalayout = "e-p:32:32-i64:64-v16:16-v24:32-v32:32-v48:64-v96:128-v192:256-v256:256-v512:512-v1024:1024"
13target triple = "spir-unknown-unknown"
14
15; Function Attrs: nounwind
16define spir_func zeroext i1 @f() #0 {
17entry:
18  ret i1 true
19}
20
21; Function Attrs: nounwind
22define spir_kernel void @test(i32 addrspace(1)* %i) #0 {
23entry:
24  %i.addr = alloca i32 addrspace(1)*, align 4
25  store i32 addrspace(1)* %i, i32 addrspace(1)** %i.addr, align 4
26  %call = call spir_func zeroext i1 @f()
27  %conv = zext i1 %call to i32
28  %0 = load i32 addrspace(1)*, i32 addrspace(1)** %i.addr, align 4
29  store i32 %conv, i32 addrspace(1)* %0, align 4
30  ret void
31}
32
33attributes #0 = { nounwind "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "no-realign-stack" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="false" }
34
35!opencl.kernels = !{!0}
36!opencl.enable.FP_CONTRACT = !{}
37!opencl.spir.version = !{!6}
38!opencl.ocl.version = !{!7}
39!opencl.used.extensions = !{!8}
40!opencl.used.optional.core.features = !{!8}
41!opencl.compiler.options = !{!8}
42
43!0 = !{void (i32 addrspace(1)*)* @test, !1, !2, !3, !4, !5}
44!1 = !{!"kernel_arg_addr_space", i32 1}
45!2 = !{!"kernel_arg_access_qual", !"none"}
46!3 = !{!"kernel_arg_type", !"int*"}
47!4 = !{!"kernel_arg_base_type", !"int*"}
48!5 = !{!"kernel_arg_type_qual", !""}
49!6 = !{i32 1, i32 2}
50!7 = !{i32 2, i32 0}
51!8 = !{}
52