1 ; RUN: llc -O0 -verify-machineinstrs -mtriple=spirv-unknown-unknown %s -o - | FileCheck %s
2 ; RUN: %if spirv-tools %{ llc -O0 -mtriple=spirv-unknown-unknown %s -o - -filetype=obj | spirv-val %}
4 ; CHECK: OpExtInstImport "GLSL.std.450"
6 define void @main() #1 {
8 %i = alloca i32, align 4
9 %absi = alloca i32, align 4
10 %f = alloca float, align 4
11 %absf = alloca float, align 4
12 %0 = load i32, ptr %i, align 4
14 ; CHECK: %[[#]] = OpExtInst %[[#]] %[[#]] SAbs %[[#]]
15 %elt.abs = call i32 @llvm.abs.i32(i32 %0, i1 false)
17 store i32 %elt.abs, ptr %absi, align 4
18 %1 = load float, ptr %f, align 4
20 ; CHECK: %[[#]] = OpExtInst %[[#]] %[[#]] FAbs %[[#]]
21 %elt.abs1 = call float @llvm.fabs.f32(float %1)
23 store float %elt.abs1, ptr %absf, align 4
27 declare i32 @llvm.abs.i32(i32, i1 immarg) #2
28 declare float @llvm.fabs.f32(float) #2