Skip to content

Commit 29d9c4a

Browse files
[SPIRV] Addition of test files for @llvm.tan and zero_length_array.ll (#142097)
Co-authored-by: Michal Paszkowski <[email protected]>
1 parent f9be391 commit 29d9c4a

File tree

2 files changed

+33
-0
lines changed

2 files changed

+33
-0
lines changed
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
; RUN: llc -verify-machineinstrs -O0 -mtriple=spirv32-unknown-unknown %s -o - | FileCheck %s
2+
; RUN: %if spirv-tools %{ llc -O0 -mtriple=spirv32-unknown-unknown %s -o - -filetype=obj | spirv-val %}
3+
4+
; CHECK-DAG: %[[#ext:]] = OpExtInstImport "OpenCL.std"
5+
; CHECK-DAG: %[[#type_f32:]] = OpTypeFloat 32
6+
; CHECK-DAG: %[[#type_f64:]] = OpTypeFloat 64
7+
; CHECK: %[[#extinst_f32:]] = OpExtInst %[[#type_f32]] %[[#ext]] tan %[[#]]
8+
; CHECK: %[[#extinst_f64:]] = OpExtInst %[[#type_f64]] %[[#ext]] tan %[[#]]
9+
10+
define float @test_tan_f32(float %x) {
11+
%res = call float @llvm.tan.f32(float %x)
12+
ret float %res
13+
}
14+
15+
define double @test_tan_f64(double %x) {
16+
%res = call double @llvm.tan.f64(double %x)
17+
ret double %res
18+
}
19+
20+
declare float @llvm.tan.f32(float)
21+
declare double @llvm.tan.f64(double)
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
; RUN: llc -verify-machineinstrs -O0 -mtriple=spirv64-unknown-unknown %s -o - | FileCheck %s
2+
; RUN: %if spirv-tools %{ llc -O0 -mtriple=spirv64-unknown-unknown %s -o - -filetype=obj | spirv-val %}
3+
4+
; CHECK: %[[#type:]] = OpTypeInt 32 0
5+
; CHECK: %[[#ext:]] = OpTypeRuntimeArray %[[#type]]
6+
; CHECK: %[[#]] = OpTypePointer Function %[[#ext]]
7+
8+
define spir_func void @_Z3foov() {
9+
entry:
10+
%i = alloca [0 x i32], align 4
11+
ret void
12+
}

0 commit comments

Comments
 (0)