1 // RUN: %clang_cc1 -w -fblocks -ffreestanding -triple i386-pc-linux-gnu -emit-llvm -o - %s | FileCheck %s
2 // RUN: %clang_cc1 -w -fblocks -ffreestanding -triple i386-pc-linux-gnu -target-feature +avx -emit-llvm -o - %s | FileCheck %s
3 // RUN: %clang_cc1 -w -fblocks -ffreestanding -triple i386-pc-linux-gnu -target-feature +avx512f -emit-llvm -o - %s | FileCheck %s
4 // RUN: %clang_cc1 -w -fblocks -ffreestanding -triple i386-pc-linux-mingw -emit-llvm -o - %s | FileCheck %s
5 // RUN: %clang_cc1 -w -fblocks -ffreestanding -triple i386-pc-linux-mingw -target-feature +avx -emit-llvm -o - %s | FileCheck %s
6 // RUN: %clang_cc1 -w -fblocks -ffreestanding -triple i386-pc-linux-mingw -target-feature +avx512f -emit-llvm -o - %s | FileCheck %s
10 // CHECK-LABEL: define dso_local void @testm128
11 // CHECK-LABEL: %argp.cur = load ptr, ptr %args, align 4
12 // CHECK-NEXT: %0 = ptrtoint ptr %argp.cur to i32
13 // CHECK-NEXT: %1 = add i32 %0, 15
14 // CHECK-NEXT: %2 = and i32 %1, -16
15 // CHECK-NEXT: %argp.cur.aligned = inttoptr i32 %2 to ptr
16 void testm128(int argCount
, ...) {
18 __builtin_va_list args
;
19 __builtin_va_start(args
, argCount
);
20 res
= __builtin_va_arg(args
, __m128
);
21 __builtin_va_end(args
);
24 // CHECK-LABEL: define dso_local void @testm256
25 // CHECK-LABEL: %argp.cur = load ptr, ptr %args, align 4
26 // CHECK-NEXT: %0 = ptrtoint ptr %argp.cur to i32
27 // CHECK-NEXT: %1 = add i32 %0, 31
28 // CHECK-NEXT: %2 = and i32 %1, -32
29 // CHECK-NEXT: %argp.cur.aligned = inttoptr i32 %2 to ptr
30 void testm256(int argCount
, ...) {
32 __builtin_va_list args
;
33 __builtin_va_start(args
, argCount
);
34 res
= __builtin_va_arg(args
, __m256
);
35 __builtin_va_end(args
);
38 // CHECK-LABEL: define dso_local void @testm512
39 // CHECK-LABEL: %argp.cur = load ptr, ptr %args, align 4
40 // CHECK-NEXT: %0 = ptrtoint ptr %argp.cur to i32
41 // CHECK-NEXT: %1 = add i32 %0, 63
42 // CHECK-NEXT: %2 = and i32 %1, -64
43 // CHECK-NEXT: %argp.cur.aligned = inttoptr i32 %2 to ptr
44 void testm512(int argCount
, ...) {
46 __builtin_va_list args
;
47 __builtin_va_start(args
, argCount
);
48 res
= __builtin_va_arg(args
, __m512
);
49 __builtin_va_end(args
);
52 // CHECK-LABEL: define dso_local void @testPastArguments
53 // CHECK: call void (i32, ...) @testm128(i32 noundef 1, <4 x float> noundef %0)
54 // CHECK: call void (i32, ...) @testm256(i32 noundef 1, <8 x float> noundef %1)
55 // CHECK: call void (i32, ...) @testm512(i32 noundef 1, <16 x float> noundef %2)
56 void testPastArguments(void) {