| 1 |
; Translator should not translate llvm intrinsic calls straight forward. |
| 2 |
; It either represents intrinsic's semantics with SPIRV instruction(s), or |
| 3 |
; reports an error. |
| 4 |
; RUN: llvm-as %s -o %t.bc |
| 5 |
; RUN: not llvm-spirv %t.bc 2>&1 | FileCheck %s |
| 6 |
|
| 7 |
; CHECK: InvalidFunctionCall: Unexpected llvm intrinsic: |
| 8 |
; CHECK-NEXT: llvm.readcyclecounter |
| 9 |
|
| 10 |
target datalayout = "e-i64:64-v16:16-v24:32-v32:32-v48:64-v96:128-v192:256-v256:256-v512:512-v1024:1024-n8:16:32:64" |
| 11 |
target triple = "spir64" |
| 12 |
|
| 13 |
; Function Attrs: nounwind |
| 14 |
define spir_func void @foo() #0 { |
| 15 |
entry: |
| 16 |
%0 = call i64 @llvm.readcyclecounter() |
| 17 |
ret void |
| 18 |
} |
| 19 |
|
| 20 |
declare i64 @llvm.readcyclecounter() |
| 21 |
|
| 22 |
attributes #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" } |
| 23 |
|
| 24 |
!opencl.enable.FP_CONTRACT = !{} |
| 25 |
!opencl.spir.version = !{!0} |
| 26 |
!opencl.ocl.version = !{!1} |
| 27 |
!opencl.used.extensions = !{!2} |
| 28 |
!opencl.used.optional.core.features = !{!3} |
| 29 |
!opencl.compiler.options = !{!2} |
| 30 |
|
| 31 |
!0 = !{i32 1, i32 2} |
| 32 |
!1 = !{i32 2, i32 0} |
| 33 |
!2 = !{} |
| 34 |
!3 = !{!"cl_doubles"} |