[clang] Handle __declspec() attributes in using
[llvm-project.git] / clang / test / CodeGen / PowerPC / ppc64-varargs-complex.c
blob5f19b2e23fb977bb0dbde6237a602bd6ea0bfdaa
1 // REQUIRES: powerpc-registered-target
2 // RUN: %clang_cc1 -triple powerpc64-unknown-linux-gnu -emit-llvm -o - %s | FileCheck %s
3 // RUN: %clang_cc1 -triple powerpc64-ibm-aix-xcoff -emit-llvm -o - %s | FileCheck %s
5 #include <stdarg.h>
7 void testva (int n, ...)
9 va_list ap;
11 _Complex int i = va_arg(ap, _Complex int);
12 // CHECK: %[[VAR40:[A-Za-z0-9.]+]] = load ptr, ptr %[[VAR100:[A-Za-z0-9.]+]]
13 // CHECK-NEXT: %[[VAR41:[A-Za-z0-9.]+]] = getelementptr inbounds i8, ptr %[[VAR40]], i64 16
14 // CHECK-NEXT: store ptr %[[VAR41]], ptr %[[VAR100]]
15 // CHECK-NEXT: %[[VAR1:[A-Za-z0-9.]+]] = getelementptr inbounds i8, ptr %[[VAR40]], i64 4
16 // CHECK-NEXT: %[[VAR2:[A-Za-z0-9.]+]] = getelementptr inbounds i8, ptr %[[VAR40]], i64 12
17 // CHECK-NEXT: %[[VAR6:[A-Za-z0-9.]+]] = load i32, ptr %[[VAR1]], align 4
18 // CHECK-NEXT: %[[VAR7:[A-Za-z0-9.]+]] = load i32, ptr %[[VAR2]], align 4
19 // CHECK-NEXT: %[[VAR8:[A-Za-z0-9.]+]] = getelementptr inbounds { i32, i32 }, ptr %[[VAR0:[A-Za-z0-9.]+]], i32 0, i32 0
20 // CHECK-NEXT: %[[VAR9:[A-Za-z0-9.]+]] = getelementptr inbounds { i32, i32 }, ptr %[[VAR0]], i32 0, i32 1
21 // CHECK-NEXT: store i32 %[[VAR6]], ptr %[[VAR8]]
22 // CHECK-NEXT: store i32 %[[VAR7]], ptr %[[VAR9]]
24 _Complex short s = va_arg(ap, _Complex short);
25 // CHECK: %[[VAR50:[A-Za-z0-9.]+]] = load ptr, ptr %[[VAR100:[A-Za-z0-9.]+]]
26 // CHECK-NEXT: %[[VAR51:[A-Za-z0-9.]+]] = getelementptr inbounds i8, ptr %[[VAR50]], i64 16
27 // CHECK-NEXT: store ptr %[[VAR51]], ptr %[[VAR100]]
28 // CHECK-NEXT: %[[VAR12:[A-Za-z0-9.]+]] = getelementptr inbounds i8, ptr %[[VAR50]], i64 6
29 // CHECK-NEXT: %[[VAR13:[A-Za-z0-9.]+]] = getelementptr inbounds i8, ptr %[[VAR50]], i64 14
30 // CHECK-NEXT: %[[VAR16:[A-Za-z0-9.]+]] = load i16, ptr %[[VAR12]], align 2
31 // CHECK-NEXT: %[[VAR17:[A-Za-z0-9.]+]] = load i16, ptr %[[VAR13]], align 2
32 // CHECK-NEXT: %[[VAR18:[A-Za-z0-9.]+]] = getelementptr inbounds { i16, i16 }, ptr %[[VAR10:[A-Za-z0-9.]+]], i32 0, i32 0
33 // CHECK-NEXT: %[[VAR19:[A-Za-z0-9.]+]] = getelementptr inbounds { i16, i16 }, ptr %[[VAR10]], i32 0, i32 1
34 // CHECK-NEXT: store i16 %[[VAR16]], ptr %[[VAR18]]
35 // CHECK-NEXT: store i16 %[[VAR17]], ptr %[[VAR19]]
37 _Complex char c = va_arg(ap, _Complex char);
38 // CHECK: %[[VAR60:[A-Za-z0-9.]+]] = load ptr, ptr %[[VAR100:[A-Za-z0-9.]+]]
39 // CHECK-NEXT: %[[VAR61:[A-Za-z0-9.]+]] = getelementptr inbounds i8, ptr %[[VAR60]], i64 16
40 // CHECK-NEXT: store ptr %[[VAR61]], ptr %[[VAR100]]
41 // CHECK-NEXT: %[[VAR24:[A-Za-z0-9.]+]] = getelementptr inbounds i8, ptr %[[VAR60]], i64 7
42 // CHECK-NEXT: %[[VAR25:[A-Za-z0-9.]+]] = getelementptr inbounds i8, ptr %[[VAR60]], i64 15
43 // CHECK-NEXT: %[[VAR26:[A-Za-z0-9.]+]] = load i8, ptr %[[VAR24]], align 1
44 // CHECK-NEXT: %[[VAR27:[A-Za-z0-9.]+]] = load i8, ptr %[[VAR25]], align 1
45 // CHECK-NEXT: %[[VAR28:[A-Za-z0-9.]+]] = getelementptr inbounds { i8, i8 }, ptr %[[VAR20:[A-Za-z0-9.]+]], i32 0, i32 0
46 // CHECK-NEXT: %[[VAR29:[A-Za-z0-9.]+]] = getelementptr inbounds { i8, i8 }, ptr %[[VAR20]], i32 0, i32 1
47 // CHECK-NEXT: store i8 %[[VAR26]], ptr %[[VAR28]]
48 // CHECK-NEXT: store i8 %[[VAR27]], ptr %[[VAR29]]
50 _Complex float f = va_arg(ap, _Complex float);
51 // CHECK: %[[VAR70:[A-Za-z0-9.]+]] = load ptr, ptr %[[VAR100:[A-Za-z0-9.]+]]
52 // CHECK-NEXT: %[[VAR71:[A-Za-z0-9.]+]] = getelementptr inbounds i8, ptr %[[VAR70]], i64 16
53 // CHECK-NEXT: store ptr %[[VAR71]], ptr %[[VAR100]]
54 // CHECK-NEXT: %[[VAR32:[A-Za-z0-9.]+]] = getelementptr inbounds i8, ptr %[[VAR70]], i64 4
55 // CHECK-NEXT: %[[VAR33:[A-Za-z0-9.]+]] = getelementptr inbounds i8, ptr %[[VAR70]], i64 12
56 // CHECK-NEXT: %[[VAR36:[A-Za-z0-9.]+]] = load float, ptr %[[VAR32]], align 4
57 // CHECK-NEXT: %[[VAR37:[A-Za-z0-9.]+]] = load float, ptr %[[VAR33]], align 4
58 // CHECK-NEXT: %[[VAR38:[A-Za-z0-9.]+]] = getelementptr inbounds { float, float }, ptr %[[VAR30:[A-Za-z0-9.]+]], i32 0, i32 0
59 // CHECK-NEXT: %[[VAR39:[A-Za-z0-9.]+]] = getelementptr inbounds { float, float }, ptr %[[VAR30]], i32 0, i32 1
60 // CHECK-NEXT: store float %[[VAR36]], ptr %[[VAR38]]
61 // CHECK-NEXT: store float %[[VAR37]], ptr %[[VAR39]]