| // Part of the Crubit project, under the Apache License v2.0 with LLVM |
| // Exceptions. See /LICENSE for license information. |
| // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception |
| // Tests for various types of expressions. |
| #include "lifetime_analysis/test/lifetime_analysis_test.h" |
| TEST_F(LifetimeAnalysisTest, IncrementAndDecrement) { |
| EXPECT_THAT(GetLifetimes(R"( |
| int* prefix_inc(int* p) { |
| int* prefix_dec(int* p) { |
| int* postfix_inc(int* p) { |
| int* postfix_dec(int* p) { |
| LifetimesAre({{"prefix_inc", "a -> a"}, |
| {"prefix_dec", "a -> a"}, |
| {"postfix_inc", "a -> a"}, |
| {"postfix_dec", "a -> a"}})); |