• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1// RUN: %clang_cc1 %s -emit-llvm -o - -triple spir-unknown-unknown | FileCheck %s
2
3typedef __attribute__(( ext_vector_type(4) )) float float4;
4
5float spscalardiv(float a, float b) {
6  // CHECK: @spscalardiv
7  // CHECK: fdiv{{.*}}, !fpmath ![[MD:[0-9]+]]
8  return a / b;
9}
10
11float4 spvectordiv(float4 a, float4 b) {
12  // CHECK: @spvectordiv
13  // CHECK: fdiv{{.*}}, !fpmath ![[MD]]
14  return a / b;
15}
16
17#pragma OPENCL EXTENSION cl_khr_fp64 : enable
18
19double dpscalardiv(double a, double b) {
20  // CHECK: @dpscalardiv
21  // CHECK-NOT: !fpmath
22  return a / b;
23}
24
25// CHECK: ![[MD]] = !{float 2.500000e+00}
26