Files
TheRock/compiler/amd-llvm/clang/test/C/C99/n809_2.c
T
derek.holloway 7502bf64a4
CodeQL / Analyze (actions) (push) Canceled after 0s
CodeQL / Analyze (python) (push) Canceled after 0s
pre-commit / pre-commit (push) Canceled after 0s
Multi-Arch CI / setup (push) Canceled after 0s
Publish build_manylinux_x86_64 images / publish_build_manylinux_x86_64 (push) Canceled after 0s
Setup (Multi-Arch) / setup (push) Canceled after 0s
Multi-Arch CI / Linux::${{ fromJSON(needs.setup.outputs.linux_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubi10 image / publish_no_rocm_image_ubi10 (push) Canceled after 0s
Multi-Arch CI / Windows::${{ fromJSON(needs.setup.outputs.windows_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Multi-Arch CI / Manifest Diff (push) Canceled after 0s
TheRock Manifest Diff Report / Generate Manifest Diff Report (push) Canceled after 0s
Multi-Arch CI / CI Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_ocl_rt images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_rocgdb images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Unit Tests / Unit Tests :: ubuntu-24.04 (push) Canceled after 0s
Unit Tests / Unit Tests :: windows-2022 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_media (push) Canceled after 0s
Unit Tests / Unit Tests Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_openmpi (push) Canceled after 0s
Flatten subprojects into a single base monorepo
2026-09-02 16:34:47 -07:00

65 lines
2.6 KiB
C

// RUN: %clang_cc1 -ast-dump -std=c99 %s | FileCheck %s
void variadic(int i, ...);
void func(void) {
// CHECK: FunctionDecl {{.*}} func 'void (void)'
// Show that we correctly convert between two complex domains.
_Complex float cf = 1.0f;
_Complex double cd;
cd = cf;
// CHECK: BinaryOperator {{.*}} '_Complex double' '='
// CHECK-NEXT: DeclRefExpr {{.*}} 'cd'
// CHECK-NEXT: ImplicitCastExpr {{.*}} '_Complex double' <FloatingComplexCast>
// CHECK-NEXT: ImplicitCastExpr {{.*}} '_Complex float' <LValueToRValue>
// CHECK-NEXT: DeclRefExpr {{.*}} 'cf'
cf = cd;
// CHECK: BinaryOperator {{.*}} '_Complex float' '='
// CHECK-NEXT: DeclRefExpr {{.*}} 'cf'
// CHECK-NEXT: ImplicitCastExpr {{.*}} '_Complex float' <FloatingComplexCast>
// CHECK-NEXT: ImplicitCastExpr {{.*}} '_Complex double' <LValueToRValue>
// CHECK-NEXT: DeclRefExpr {{.*}} 'cd'
// Show that we correctly convert to the common type of a complex and real.
// This should convert the _Complex float to a _Complex double ("without
// change of domain" c.f. C99 6.3.1.8p1).
(void)(cf + 1.0);
// CHECK: BinaryOperator {{.*}} '_Complex double' '+'
// CHECK-NEXT: ImplicitCastExpr {{.*}} '_Complex double' <FloatingComplexCast>
// CHECK-NEXT: ImplicitCastExpr {{.*}} '_Complex float' <LValueToRValue>
// CHECK-NEXT: DeclRefExpr {{.*}} 'cf'
// CHECK-NEXT: FloatingLiteral {{.*}} 'double' 1.0
// This should convert the float constant to double, then produce a
// _Complex double.
(void)(cd + 1.0f);
// CHECK: BinaryOperator {{.*}} '_Complex double' '+'
// CHECK-NEXT: ImplicitCastExpr {{.*}} '_Complex double' <LValueToRValue>
// CHECK-NEXT: DeclRefExpr {{.*}} 'cd'
// CHECK-NEXT: ImplicitCastExpr {{.*}} 'double' <FloatingCast>
// CHECK-NEXT: FloatingLiteral {{.*}} 'float' 1.0
// This should convert the int constant to float, then produce a
// _Complex float.
(void)(cf + 1);
// CHECK: BinaryOperator {{.*}} '_Complex float' '+'
// CHECK-NEXT: ImplicitCastExpr {{.*}} '_Complex float' <LValueToRValue>
// CHECK-NEXT: DeclRefExpr {{.*}} 'cf'
// CHECK-NEXT: ImplicitCastExpr {{.*}} 'float' <IntegralToFloating>
// CHECK-NEXT: IntegerLiteral {{.*}} 'int' 1
// Show that we do not promote a _Complex float to _Complex double as part of
// the default argument promotions when passing to a variadic function.
variadic(1, cf);
// CHECK: CallExpr
// CHECK-NEXT: ImplicitCastExpr {{.*}} <FunctionToPointerDecay>
// CHECK-NEXT: DeclRefExpr {{.*}} 'variadic'
// CHECK-NEXT: IntegerLiteral {{.*}} 'int' 1
// CHECK-NEXT: ImplicitCastExpr {{.*}} '_Complex float' <LValueToRValue>
// CHECK-NEXT: DeclRefExpr {{.*}} 'cf'
}