2014-08-21 21:58:36 +08:00
|
|
|
// RUN: %clang_cc1 -S -cl-denorms-are-zero -o - %s 2>&1
|
2016-08-10 03:43:38 +08:00
|
|
|
// RUN: %clang_cc1 -emit-llvm -cl-denorms-are-zero -o - -triple amdgcn--amdhsa -target-cpu fiji %s | FileCheck %s
|
|
|
|
// RUN: %clang_cc1 -emit-llvm -o - -triple amdgcn--amdhsa -target-cpu fiji %s | FileCheck %s --check-prefix=CHECK-DENORM
|
2016-09-14 01:37:09 +08:00
|
|
|
// RUN: %clang_cc1 -emit-llvm -target-feature +fp32-denormals -target-feature -fp64-denormals -cl-denorms-are-zero -o - -triple amdgcn--amdhsa -target-cpu fiji %s | FileCheck --check-prefix=CHECK-FEATURE %s
|
2014-08-21 21:58:36 +08:00
|
|
|
|
2016-08-10 03:43:38 +08:00
|
|
|
// For non-amdgcn targets, this test just checks that the -cl-denorms-are-zero argument is accepted
|
2014-08-21 21:58:36 +08:00
|
|
|
// by clang. This option is currently a no-op, which is allowed by the
|
|
|
|
// OpenCL specification.
|
2016-08-10 03:43:38 +08:00
|
|
|
|
2016-09-14 01:37:09 +08:00
|
|
|
// For amdgcn target cpu fiji, fp32 should be flushed since fiji does not support fp32 denormals, unless +fp32-denormals is
|
|
|
|
// explicitly set. amdgcn target always do not flush fp64 denormals.
|
|
|
|
|
2016-08-10 03:43:38 +08:00
|
|
|
// CHECK-DENORM-LABEL: define void @f()
|
2016-09-14 01:37:09 +08:00
|
|
|
// CHECK-DENORM: attributes #{{[0-9]*}} = {{{[^}]*}} "target-features"="{{[^"]*}}+fp64-denormals,{{[^"]*}}-fp32-denormals{{[^"]*}}"
|
2016-08-10 03:43:38 +08:00
|
|
|
// CHECK-LABEL: define void @f()
|
2016-09-14 01:37:09 +08:00
|
|
|
// CHECK: attributes #{{[0-9]*}} = {{{[^}]*}} "target-features"="{{[^"]*}}+fp64-denormals,{{[^"]*}}-fp32-denormals{{[^"]*}}"
|
|
|
|
// CHECK-FEATURE-LABEL: define void @f()
|
|
|
|
// CHECK-FEATURE: attributes #{{[0-9]*}} = {{{[^}]*}} "target-features"="{{[^"]*}}+fp32-denormals,{{[^"]*}}-fp64-denormals{{[^"]*}}"
|
2016-08-10 03:43:38 +08:00
|
|
|
void f() {}
|