aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/asan/pr85081.C
diff options
context:
space:
mode:
authorAndre Vieira <andre.simoesdiasvieira@arm.com>2018-06-22 14:59:21 +0000
committerAndre Vieira <andre.simoesdiasvieira@arm.com>2018-06-22 14:59:21 +0000
commit80bb895d235d82f30bb097050acc82470b53cf52 (patch)
treed887d893f39d16e4990a853d3398dfc48433430f /gcc/testsuite/g++.dg/asan/pr85081.C
parent701c5838e5f5999de48c3b2c9f2e10b453a78f88 (diff)
parent8483773478af7ea732b52a98e325a07608777ebe (diff)
git-svn-id: https://gcc.gnu.org/svn/gcc/branches/ARM/embedded-7-branch@261903 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/testsuite/g++.dg/asan/pr85081.C')
-rw-r--r--gcc/testsuite/g++.dg/asan/pr85081.C20
1 files changed, 20 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/asan/pr85081.C b/gcc/testsuite/g++.dg/asan/pr85081.C
new file mode 100644
index 00000000000..d7dec311450
--- /dev/null
+++ b/gcc/testsuite/g++.dg/asan/pr85081.C
@@ -0,0 +1,20 @@
+/* PR sanitizer/85081 */
+/* { dg-do run } */
+/* { dg-options "-fopenmp-simd" } */
+/* { dg-require-effective-target fopenmp } */
+
+inline const int& max(const int& a, const int& b)
+{
+ return a < b ? b : a;
+}
+
+int main()
+{
+ #pragma omp simd
+ for ( int i = 0; i < 20; ++i )
+ {
+ const int j = max(i, 1);
+ }
+
+ return 0;
+}