Summary: This was forbidden previously, which made us divergent with the GCC implementation. Permit this by simply removing this Sema check. Fixes: https://github.com/llvm/llvm-project/issues/156463
23 lines
1.2 KiB
C
23 lines
1.2 KiB
C
// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py UTC_ARGS: --version 5
|
|
// RUN: %clang_cc1 -triple x86_64-linux-gnu -emit-llvm %s -o - | FileCheck %s
|
|
|
|
// CHECK-LABEL: define dso_local <2 x half> @builtin_complex(
|
|
// CHECK-SAME: ) #[[ATTR0:[0-9]+]] {
|
|
// CHECK-NEXT: [[ENTRY:.*:]]
|
|
// CHECK-NEXT: [[RETVAL:%.*]] = alloca { half, half }, align 2
|
|
// CHECK-NEXT: [[A:%.*]] = alloca half, align 2
|
|
// CHECK-NEXT: store half 0xH0000, ptr [[A]], align 2
|
|
// CHECK-NEXT: [[TMP0:%.*]] = load half, ptr [[A]], align 2
|
|
// CHECK-NEXT: [[TMP1:%.*]] = load half, ptr [[A]], align 2
|
|
// CHECK-NEXT: [[RETVAL_REALP:%.*]] = getelementptr inbounds nuw { half, half }, ptr [[RETVAL]], i32 0, i32 0
|
|
// CHECK-NEXT: [[RETVAL_IMAGP:%.*]] = getelementptr inbounds nuw { half, half }, ptr [[RETVAL]], i32 0, i32 1
|
|
// CHECK-NEXT: store half [[TMP0]], ptr [[RETVAL_REALP]], align 2
|
|
// CHECK-NEXT: store half [[TMP1]], ptr [[RETVAL_IMAGP]], align 2
|
|
// CHECK-NEXT: [[TMP2:%.*]] = load <2 x half>, ptr [[RETVAL]], align 2
|
|
// CHECK-NEXT: ret <2 x half> [[TMP2]]
|
|
//
|
|
_Complex _Float16 builtin_complex(void) {
|
|
_Float16 a = 0;
|
|
return __builtin_complex(a, a);
|
|
}
|