From 85b92c1df1b8c1003ea6f6544b21b028e50881f7 Mon Sep 17 00:00:00 2001 From: Dmytro Shynkevych Date: Sun, 19 Aug 2018 06:07:04 -0400 Subject: Added test --- src/test/codegen/issue-53080.rs | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 src/test/codegen/issue-53080.rs (limited to 'src/test/codegen') diff --git a/src/test/codegen/issue-53080.rs b/src/test/codegen/issue-53080.rs new file mode 100644 index 00000000000..9289fb3b295 --- /dev/null +++ b/src/test/codegen/issue-53080.rs @@ -0,0 +1,19 @@ +// Copyright 2018 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +// A drop([...].clone()) sequence on an Rc should be a no-op +// In particular, no call to __rust_dealloc should be emitted +#![crate_type = "lib"] +use std::rc::Rc; + +pub fn foo(t: &Rc>) { +// CHECK-NOT: __rust_dealloc + drop(t.clone()); +} -- cgit 1.4.1-3-g733a5 From 0b839146130e43c557425fc04537e7d0033cdc6b Mon Sep 17 00:00:00 2001 From: Dmytro Shynkevych Date: Mon, 20 Aug 2018 02:19:28 -0400 Subject: Renamed test to match actual issue number --- src/test/codegen/issue-13018.rs | 19 +++++++++++++++++++ src/test/codegen/issue-53080.rs | 19 ------------------- 2 files changed, 19 insertions(+), 19 deletions(-) create mode 100644 src/test/codegen/issue-13018.rs delete mode 100644 src/test/codegen/issue-53080.rs (limited to 'src/test/codegen') diff --git a/src/test/codegen/issue-13018.rs b/src/test/codegen/issue-13018.rs new file mode 100644 index 00000000000..9289fb3b295 --- /dev/null +++ b/src/test/codegen/issue-13018.rs @@ -0,0 +1,19 @@ +// Copyright 2018 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +// A drop([...].clone()) sequence on an Rc should be a no-op +// In particular, no call to __rust_dealloc should be emitted +#![crate_type = "lib"] +use std::rc::Rc; + +pub fn foo(t: &Rc>) { +// CHECK-NOT: __rust_dealloc + drop(t.clone()); +} diff --git a/src/test/codegen/issue-53080.rs b/src/test/codegen/issue-53080.rs deleted file mode 100644 index 9289fb3b295..00000000000 --- a/src/test/codegen/issue-53080.rs +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2018 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -// A drop([...].clone()) sequence on an Rc should be a no-op -// In particular, no call to __rust_dealloc should be emitted -#![crate_type = "lib"] -use std::rc::Rc; - -pub fn foo(t: &Rc>) { -// CHECK-NOT: __rust_dealloc - drop(t.clone()); -} -- cgit 1.4.1-3-g733a5 From 79a905ef305b1c3048ad2535887951721ab65f5c Mon Sep 17 00:00:00 2001 From: Dmytro Shynkevych Date: Mon, 20 Aug 2018 11:13:45 -0400 Subject: Added explicit optimization flag to test --- src/test/codegen/issue-13018.rs | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/test/codegen') diff --git a/src/test/codegen/issue-13018.rs b/src/test/codegen/issue-13018.rs index 9289fb3b295..702b9545794 100644 --- a/src/test/codegen/issue-13018.rs +++ b/src/test/codegen/issue-13018.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +// compile-flags: -O + // A drop([...].clone()) sequence on an Rc should be a no-op // In particular, no call to __rust_dealloc should be emitted #![crate_type = "lib"] -- cgit 1.4.1-3-g733a5