[AMDGPU][True16][CodeGen] true16 codegen pattern for v_med3_u/i16 (#121850)
[llvm-project.git] / clang / test / CodeGenCXX / x86_32-vaarg.cpp
blob90665652a0286aed0ac6339581f85034361c29ec
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(
7 // CHECK-NEXT: entry:
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);
22 typedef struct {
23 struct {
24 int a[0];
25 } b;
26 } SortOfEmpty;
28 // CHECK-LABEL: @_Z18test_sort_of_emptyiz(
29 // CHECK-NEXT: entry:
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);