aboutsummaryrefslogtreecommitdiff
path: root/clang/test/CodeGen/complex_Float16.c
blob: d2552074bc7cd9d26946efad25e739fa58067ddd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
// 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);
}