Compiler projects using llvm
// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py
// REQUIRES: powerpc-registered-target
// RUN: %clang_cc1 -no-opaque-pointers -triple powerpc64-unknown-linux-gnu \
// RUN:   -emit-llvm %s -o - -target-cpu pwr7 | FileCheck %s
// RUN: %clang_cc1 -no-opaque-pointers -triple powerpc64le-unknown-linux-gnu \
// RUN:   -emit-llvm %s -o - -target-cpu pwr8 | FileCheck %s

// The argument expression must not be emitted multiple times

// CHECK-LABEL: @test_fric(
// CHECK-NEXT:  entry:
// CHECK-NEXT:    [[D:%.*]] = alloca double, align 8
// CHECK-NEXT:    [[TMP:%.*]] = alloca double, align 8
// CHECK-NEXT:    [[TMP0:%.*]] = load double, double* [[D]], align 8
// CHECK-NEXT:    store double [[TMP0]], double* [[TMP]], align 8
// CHECK-NEXT:    [[TMP1:%.*]] = load double, double* [[TMP]], align 8
// CHECK-NEXT:    [[TMP2:%.*]] = call double @llvm.rint.f64(double [[TMP1]])
// CHECK-NEXT:    ret void
//
void test_fric() {
  __fric(({double d; d;}));
}