1 //===----------------------------------------------------------------------===// 2 // 3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4 // See https://llvm.org/LICENSE.txt for license information. 5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6 // 7 //===----------------------------------------------------------------------===// 8 9 // <complex> 10 11 // template<class T> 12 // complex<T> 13 // operator/(const T& lhs, const complex<T>& rhs); 14 15 #include <complex> 16 #include <cassert> 17 18 template <class T> 19 void 20 test(const T& lhs, const std::complex<T>& rhs, std::complex<T> x) 21 { 22 assert(lhs / rhs == x); 23 } 24 25 template <class T> 26 void 27 test() 28 { 29 T lhs(-8.5); 30 std::complex<T> rhs(1.5, 2.5); 31 std::complex<T> x(-1.5, 2.5); 32 test(lhs, rhs, x); 33 } 34 35 int main(int, char**) 36 { 37 test<float>(); 38 test<double>(); 39 test<long double>(); 40 41 return 0; 42 } 43