brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.1 KiB · 48cfe26 Raw
35 lines · plain
1! Test lowering of atomic write to LLVM IR for complex types.2! This is a regression test for issue #165184.3 4! RUN: %flang_fc1 -emit-llvm -fopenmp -o - %s | FileCheck %s5 6! Test that atomic write operations with complex types emit the correct7! size parameter to __atomic_store:8! - complex(4) (8 bytes total): should call __atomic_store(i64 8, ...)9! - complex(8) (16 bytes total): should call __atomic_store(i64 16, ...)10 11program atomic_write_complex12  implicit none13 14  ! Test complex(4) - single precision (8 bytes)15  complex(4) :: c41, c4216  ! Test complex(8) - double precision (16 bytes)  17  complex(8) :: c81, c8218  19  c42 = (1.0_4, 1.0_4)20  c82 = (1.0_8, 1.0_8)21 22  ! CHECK-LABEL: define {{.*}} @_QQmain23  24  ! Single precision complex: 8 bytes25  ! CHECK: call void @__atomic_store(i64 8, ptr {{.*}}, ptr {{.*}}, i32 {{.*}})26!$omp atomic write27  c41 = c4228  29  ! Double precision complex: 16 bytes (this was broken before the fix)30  ! CHECK: call void @__atomic_store(i64 16, ptr {{.*}}, ptr {{.*}}, i32 {{.*}})31!$omp atomic write32  c81 = c8233 34end program atomic_write_complex35