mirror of
https://github.com/Gericom/teak-llvm.git
synced 2025-06-20 12:05:48 -04:00

Since "half" is an OpenCL keyword and clang accepts __fp16 as an extension for other languages, error messages and metadata (and hence debug info) should refer to the half-precision floating point as "__fp16" instead of "half" when compiling for non-OpenCL languages. This patch creates a new printing policy for half in a similar manner to what is done for bool and wchar_t. Differential Revision: http://llvm-reviews.chandlerc.com/D2952 llvm-svn: 204164
14 lines
339 B
C
14 lines
339 B
C
// RUN: %clang_cc1 -ast-dump %s | FileCheck %s
|
|
|
|
void variadic(int, ...);
|
|
|
|
void test_floating_promotion(__fp16 *f16, float f32, double f64) {
|
|
variadic(3, *f16, f32, f64);
|
|
|
|
// CHECK: ImplicitCastExpr {{.*}} 'double' <FloatingCast>
|
|
// CHECK-NEXT: '__fp16'
|
|
|
|
// CHECK: ImplicitCastExpr {{.*}} 'double' <FloatingCast>
|
|
// CHECK-NEXT: 'float'
|
|
}
|