File: ppc64le-varargs-complex.c

package info (click to toggle)
llvm-toolchain-20 1%3A20.1.6-1~exp1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 2,111,304 kB
  • sloc: cpp: 7,438,677; ansic: 1,393,822; asm: 1,012,926; python: 241,650; f90: 86,635; objc: 75,479; lisp: 42,144; pascal: 17,286; sh: 10,027; ml: 5,082; perl: 4,730; awk: 3,523; makefile: 3,349; javascript: 2,251; xml: 892; fortran: 672
file content (57 lines) | stat: -rw-r--r-- 3,696 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
// REQUIRES: powerpc-registered-target
// RUN: %clang_cc1 -triple powerpc64le-unknown-linux-gnu -emit-llvm -o - %s | FileCheck %s

#include <stdarg.h>

void testva (int n, ...)
{
  va_list ap;

  _Complex int i   = va_arg(ap, _Complex int);
  // CHECK: %[[VAR40:[A-Za-z0-9.]+]] = load ptr, ptr %[[VAR100:[A-Za-z0-9.]+]]
  // CHECK-NEXT: %[[VAR41:[A-Za-z0-9.]+]] = getelementptr inbounds i8, ptr %[[VAR40]], i64 16
  // CHECK-NEXT: store ptr %[[VAR41]], ptr %[[VAR100]]
  // CHECK-NEXT: %[[VAR3:[A-Za-z0-9.]+]] = getelementptr inbounds i8, ptr %[[VAR40]], i64 8
  // CHECK-NEXT: %[[VAR6:[A-Za-z0-9.]+]] = load i32, ptr %[[VAR40]], align 8
  // CHECK-NEXT: %[[VAR7:[A-Za-z0-9.]+]] = load i32, ptr %[[VAR3]], align 8
  // CHECK-NEXT: %[[VAR8:[A-Za-z0-9.]+]] = getelementptr inbounds nuw { i32, i32 }, ptr %[[VAR0:[A-Za-z0-9.]+]], i32 0, i32 0
  // CHECK-NEXT: %[[VAR9:[A-Za-z0-9.]+]] = getelementptr inbounds nuw { i32, i32 }, ptr %[[VAR0]], i32 0, i32 1
  // CHECK-NEXT: store i32 %[[VAR6]], ptr %[[VAR8]]
  // CHECK-NEXT: store i32 %[[VAR7]], ptr %[[VAR9]]

  _Complex short s = va_arg(ap, _Complex short);
  // CHECK: %[[VAR50:[A-Za-z0-9.]+]] = load ptr, ptr %[[VAR100:[A-Za-z0-9.]+]]
  // CHECK-NEXT: %[[VAR51:[A-Za-z0-9.]+]] = getelementptr inbounds i8, ptr %[[VAR50]], i64 16
  // CHECK-NEXT: store ptr %[[VAR51]], ptr %[[VAR100]]
  // CHECK-NEXT: %[[VAR13:[A-Za-z0-9.]+]] = getelementptr inbounds i8, ptr %[[VAR50]], i64 8
  // CHECK-NEXT: %[[VAR16:[A-Za-z0-9.]+]] = load i16, ptr %[[VAR50]], align 8
  // CHECK-NEXT: %[[VAR17:[A-Za-z0-9.]+]] = load i16, ptr %[[VAR13]], align 8
  // CHECK-NEXT: %[[VAR18:[A-Za-z0-9.]+]] = getelementptr inbounds nuw { i16, i16 }, ptr %[[VAR10:[A-Za-z0-9.]+]], i32 0, i32 0
  // CHECK-NEXT: %[[VAR19:[A-Za-z0-9.]+]] = getelementptr inbounds nuw { i16, i16 }, ptr %[[VAR10]], i32 0, i32 1
  // CHECK-NEXT: store i16 %[[VAR16]], ptr %[[VAR18]]
  // CHECK-NEXT: store i16 %[[VAR17]], ptr %[[VAR19]]

  _Complex char c  = va_arg(ap, _Complex char);
  // CHECK: %[[VAR60:[A-Za-z0-9.]+]] = load ptr, ptr %[[VAR100:[A-Za-z0-9.]+]]
  // CHECK-NEXT: %[[VAR61:[A-Za-z0-9.]+]] = getelementptr inbounds i8, ptr %[[VAR60]], i64 16
  // CHECK-NEXT: store ptr %[[VAR61]], ptr %[[VAR100]]
  // CHECK-NEXT: %[[VAR25:[A-Za-z0-9.]+]] = getelementptr inbounds i8, ptr %[[VAR60]], i64 8
  // CHECK-NEXT: %[[VAR26:[A-Za-z0-9.]+]] = load i8, ptr %[[VAR60]], align 8
  // CHECK-NEXT: %[[VAR27:[A-Za-z0-9.]+]] = load i8, ptr %[[VAR25]], align 8
  // CHECK-NEXT: %[[VAR28:[A-Za-z0-9.]+]] = getelementptr inbounds nuw { i8, i8 }, ptr %[[VAR20:[A-Za-z0-9.]+]], i32 0, i32 0
  // CHECK-NEXT: %[[VAR29:[A-Za-z0-9.]+]] = getelementptr inbounds nuw { i8, i8 }, ptr %[[VAR20]], i32 0, i32 1
  // CHECK-NEXT: store i8 %[[VAR26]], ptr %[[VAR28]]
  // CHECK-NEXT: store i8 %[[VAR27]], ptr %[[VAR29]]

  _Complex float f = va_arg(ap, _Complex float);
  // CHECK: %[[VAR70:[A-Za-z0-9.]+]] = load ptr, ptr %[[VAR100:[A-Za-z0-9.]+]]
  // CHECK-NEXT: %[[VAR71:[A-Za-z0-9.]+]] = getelementptr inbounds i8, ptr %[[VAR70]], i64 16
  // CHECK-NEXT: store ptr %[[VAR71]], ptr %[[VAR100]]
  // CHECK-NEXT: %[[VAR33:[A-Za-z0-9.]+]] = getelementptr inbounds i8, ptr %[[VAR70]], i64 8
  // CHECK-NEXT: %[[VAR36:[A-Za-z0-9.]+]] = load float, ptr %[[VAR70]], align 8
  // CHECK-NEXT: %[[VAR37:[A-Za-z0-9.]+]] = load float, ptr %[[VAR33]], align 8
  // CHECK-NEXT: %[[VAR38:[A-Za-z0-9.]+]] = getelementptr inbounds nuw { float, float }, ptr %[[VAR30:[A-Za-z0-9.]+]], i32 0, i32 0
  // CHECK-NEXT: %[[VAR39:[A-Za-z0-9.]+]] = getelementptr inbounds nuw { float, float }, ptr %[[VAR30]], i32 0, i32 1
  // CHECK-NEXT: store float %[[VAR36]], ptr %[[VAR38]]
  // CHECK-NEXT: store float %[[VAR37]], ptr %[[VAR39]]
}