xref: /llvm-project/clang/test/CodeGen/AArch64/attr-mode-complex.c (revision 207e5ccceec8d3cc3f32723e78f2a142bc61b07d)
1*207e5cccSFangrui Song // RUN: %clang_cc1 -triple arm64-none-linux-gnu -emit-llvm %s -o - | FileCheck %s
2*207e5cccSFangrui Song 
3*207e5cccSFangrui Song typedef _Complex float c16a __attribute((mode(HC)));
4*207e5cccSFangrui Song typedef _Complex double c16b __attribute((mode(HC)));
5*207e5cccSFangrui Song typedef _Complex float c32a __attribute((mode(SC)));
6*207e5cccSFangrui Song typedef _Complex double c32b __attribute((mode(SC)));
7*207e5cccSFangrui Song typedef _Complex float c64a __attribute((mode(DC)));
8*207e5cccSFangrui Song typedef _Complex double c64b __attribute((mode(DC)));
9*207e5cccSFangrui Song 
10*207e5cccSFangrui Song // CHECK: define{{.*}} { half, half } @c16_test([2 x half] noundef {{.*}}
11*207e5cccSFangrui Song // CHECK:   ret { half, half } {{.*}}
12*207e5cccSFangrui Song c16b c16_test(c16a x) {
13*207e5cccSFangrui Song   return x + x;
14*207e5cccSFangrui Song }
15*207e5cccSFangrui Song 
16*207e5cccSFangrui Song // CHECK: define{{.*}} { float, float } @c32_test([2 x float] noundef {{.*}})
17*207e5cccSFangrui Song // CHECK:   ret { float, float } {{.*}}
18*207e5cccSFangrui Song c32b c32_test(c32a x) {
19*207e5cccSFangrui Song   return x + x;
20*207e5cccSFangrui Song }
21*207e5cccSFangrui Song 
22*207e5cccSFangrui Song // CHECK: define{{.*}} { double, double } @c64_test([2 x double] noundef {{.*}})
23*207e5cccSFangrui Song // CHECK:   ret { double, double } {{.*}}
24*207e5cccSFangrui Song c64b c64_test(c64a x) {
25*207e5cccSFangrui Song   return x + x;
26*207e5cccSFangrui Song }
27