1 // NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py
2 // RUN: %clang_cc1 -triple i386-linux-gnu -emit-llvm -o - %s | FileCheck %s
4 typedef struct {} empty
;
6 // CHECK-LABEL: @_Z17empty_record_testiz(
8 // CHECK-NEXT: [[RESULT_PTR:%.*]] = alloca ptr, align 4
9 // CHECK-NEXT: [[Z_ADDR:%.*]] = alloca i32, align 4
10 // CHECK-NEXT: [[LIST:%.*]] = alloca ptr, align 4
11 // CHECK-NEXT: store ptr [[AGG_RESULT:%.*]], ptr [[RESULT_PTR]], align 4
12 // CHECK-NEXT: store i32 [[Z:%.*]], ptr [[Z_ADDR]], align 4
13 // CHECK-NEXT: call void @llvm.va_start.p0(ptr [[LIST]])
14 // CHECK-NEXT: ret void
16 empty
empty_record_test(int z
, ...) {
17 __builtin_va_list list
;
18 __builtin_va_start(list
, z
);
19 return __builtin_va_arg(list
, empty
);
28 // CHECK-LABEL: @_Z18test_sort_of_emptyiz(
30 // CHECK-NEXT: [[RESULT_PTR:%.*]] = alloca ptr, align 4
31 // CHECK-NEXT: [[Z_ADDR:%.*]] = alloca i32, align 4
32 // CHECK-NEXT: [[LIST:%.*]] = alloca ptr, align 4
33 // CHECK-NEXT: store ptr [[AGG_RESULT:%.*]], ptr [[RESULT_PTR]], align 4
34 // CHECK-NEXT: store i32 [[Z:%.*]], ptr [[Z_ADDR]], align 4
35 // CHECK-NEXT: call void @llvm.va_start.p0(ptr [[LIST]])
36 // CHECK-NEXT: ret void
38 SortOfEmpty
test_sort_of_empty(int z
, ...) {
39 __builtin_va_list list
;
40 __builtin_va_start(list
, z
);
41 return __builtin_va_arg(list
, SortOfEmpty
);