From d35c7e3888720216d9f3f8d1a5e067841c35c906 Mon Sep 17 00:00:00 2001 From: Christopher Lamb Date: Sun, 29 Jul 2007 23:29:16 +0000 Subject: Add tests for generating noalias parameter attribute from __restrict qualified function parameters. C++ tests are currently XFAILing see PR1582. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40583 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/C++Frontend/2007-07-29-RestrictPtrArg.cpp | 8 ++++++++ test/C++Frontend/2007-07-29-RestrictRefArg.cpp | 8 ++++++++ 2 files changed, 16 insertions(+) create mode 100644 test/C++Frontend/2007-07-29-RestrictPtrArg.cpp create mode 100644 test/C++Frontend/2007-07-29-RestrictRefArg.cpp (limited to 'test/C++Frontend') diff --git a/test/C++Frontend/2007-07-29-RestrictPtrArg.cpp b/test/C++Frontend/2007-07-29-RestrictPtrArg.cpp new file mode 100644 index 0000000..e45eda0 --- /dev/null +++ b/test/C++Frontend/2007-07-29-RestrictPtrArg.cpp @@ -0,0 +1,8 @@ +// RUN: %llvmgxx -c -emit-llvm %s -o - | llvm-dis | grep noalias +// XFAIL: i[1-9]86|alpha|ia64|arm|x86_64|amd64 +// NOTE: This should be un-XFAILed when the C++ type qualifiers are fixed + +void foo(int * __restrict myptr1, int * myptr2) { + myptr1[0] = 0; + myptr2[0] = 0; +} diff --git a/test/C++Frontend/2007-07-29-RestrictRefArg.cpp b/test/C++Frontend/2007-07-29-RestrictRefArg.cpp new file mode 100644 index 0000000..e1b5cd6 --- /dev/null +++ b/test/C++Frontend/2007-07-29-RestrictRefArg.cpp @@ -0,0 +1,8 @@ +// RUN: %llvmgxx -c -emit-llvm %s -o - | llvm-dis | grep noalias +// XFAIL: i[1-9]86|alpha|ia64|arm|x86_64|amd64 +// NOTE: This should be un-XFAILed when the C++ type qualifiers are fixed + +void foo(int & __restrict myptr1, int & myptr2) { + myptr1 = 0; + myptr2 = 0; +} -- cgit v1.1