// RUN: cir-opt %s -cir-to-llvm -o - | FileCheck %s -check-prefix=MLIR // RUN: cir-translate %s -cir-to-llvmir --target x86_64-unknown-linux-gnu --disable-cc-lowering | FileCheck %s -check-prefix=LLVM module { cir.func @foo() { %0 = cir.alloca !cir.float, !cir.ptr, ["c"] {alignment = 4 : i64} %1 = cir.alloca !cir.float, !cir.ptr, ["d"] {alignment = 4 : i64} %2 = cir.alloca !cir.float, !cir.ptr, ["y", init] {alignment = 4 : i64} %3 = cir.alloca !cir.double, !cir.ptr, ["e"] {alignment = 8 : i64} %4 = cir.alloca !cir.double, !cir.ptr, ["f"] {alignment = 8 : i64} %5 = cir.alloca !cir.double, !cir.ptr, ["g", init] {alignment = 8 : i64} %6 = cir.load %0 : !cir.ptr, !cir.float %7 = cir.load %1 : !cir.ptr, !cir.float %8 = cir.mul %6, %7 : !cir.float cir.store %8, %2 : !cir.float, !cir.ptr %9 = cir.load %2 : !cir.ptr, !cir.float %10 = cir.load %1 : !cir.ptr, !cir.float %11 = cir.div %9, %10 : !cir.float cir.store %11, %2 : !cir.float, !cir.ptr %12 = cir.load %2 : !cir.ptr, !cir.float %13 = cir.load %1 : !cir.ptr, !cir.float %14 = cir.add %12, %13 : !cir.float cir.store %14, %2 : !cir.float, !cir.ptr %15 = cir.load %2 : !cir.ptr, !cir.float %16 = cir.load %1 : !cir.ptr, !cir.float %17 = cir.sub %15, %16 : !cir.float cir.store %17, %2 : !cir.float, !cir.ptr %18 = cir.load %3 : !cir.ptr, !cir.double %19 = cir.load %4 : !cir.ptr, !cir.double %20 = cir.add %18, %19 : !cir.double cir.store %20, %5 : !cir.double, !cir.ptr %21 = cir.load %3 : !cir.ptr, !cir.double %22 = cir.load %4 : !cir.ptr, !cir.double %23 = cir.sub %21, %22 : !cir.double cir.store %23, %5 : !cir.double, !cir.ptr %24 = cir.load %3 : !cir.ptr, !cir.double %25 = cir.load %4 : !cir.ptr, !cir.double %26 = cir.mul %24, %25 : !cir.double cir.store %26, %5 : !cir.double, !cir.ptr %27 = cir.load %3 : !cir.ptr, !cir.double %28 = cir.load %4 : !cir.ptr, !cir.double %29 = cir.div %27, %28 : !cir.double cir.store %29, %5 : !cir.double, !cir.ptr cir.return } } // MLIR: = llvm.alloca {{.*}} f32 {alignment = 4 : i64} : (i64) -> !llvm.ptr // MLIR: = llvm.alloca {{.*}} f64 {alignment = 8 : i64} : (i64) -> !llvm.ptr // MLIR: = llvm.fmul {{.*}} : f32 // MLIR: = llvm.fdiv // MLIR: = llvm.fadd // MLIR: = llvm.fsub // MLIR: = llvm.fadd {{.*}} : f64 // MLIR: = llvm.fsub // MLIR: = llvm.fmul // MLIR: = llvm.fdiv // LLVM: = alloca float, i64 // LLVM: = alloca double, i64 // LLVM: = fmul float // LLVM: = fdiv float // LLVM: = fadd float // LLVM: = fsub float // LLVM: = fadd double // LLVM: = fsub double // LLVM: = fmul double // LLVM: = fdiv double