aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Lamb <christopher.lamb@gmail.com>2007-07-29 23:29:16 +0000
committerChristopher Lamb <christopher.lamb@gmail.com>2007-07-29 23:29:16 +0000
commitdb9530599e0cdacbaea0b4a714742df0829cab5c (patch)
tree44f17b197052073b9ba8083b81372b815400f5cf
parent6551606a99bfa342466432b72fdbe8f0c85c1282 (diff)
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
-rw-r--r--test/C++Frontend/2007-07-29-RestrictPtrArg.cpp8
-rw-r--r--test/C++Frontend/2007-07-29-RestrictRefArg.cpp8
-rw-r--r--test/CFrontend/2007-07-29-RestrictPtrArg.c6
3 files changed, 22 insertions, 0 deletions
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 0000000000..e45eda0784
--- /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 0000000000..e1b5cd60e1
--- /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;
+}
diff --git a/test/CFrontend/2007-07-29-RestrictPtrArg.c b/test/CFrontend/2007-07-29-RestrictPtrArg.c
new file mode 100644
index 0000000000..be09108b34
--- /dev/null
+++ b/test/CFrontend/2007-07-29-RestrictPtrArg.c
@@ -0,0 +1,6 @@
+// RUN: %llvmgxx -c -emit-llvm %s -o - | llvm-dis | grep noalias
+
+void foo(int * __restrict myptr1, int * myptr2) {
+ myptr1[0] = 0;
+ myptr2[0] = 0;
+} \ No newline at end of file