Add tests for generating noalias parameter attribute from __restrict qualified functi...
authorChristopher Lamb <christopher.lamb@gmail.com>
Sun, 29 Jul 2007 23:29:16 +0000 (23:29 +0000)
committerChristopher Lamb <christopher.lamb@gmail.com>
Sun, 29 Jul 2007 23:29:16 +0000 (23:29 +0000)
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 [new file with mode: 0644]
test/C++Frontend/2007-07-29-RestrictRefArg.cpp [new file with mode: 0644]
test/CFrontend/2007-07-29-RestrictPtrArg.c [new file with mode: 0644]

diff --git a/test/C++Frontend/2007-07-29-RestrictPtrArg.cpp b/test/C++Frontend/2007-07-29-RestrictPtrArg.cpp
new file mode 100644 (file)
index 0000000..e45eda0
--- /dev/null
@@ -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 (file)
index 0000000..e1b5cd6
--- /dev/null
@@ -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 (file)
index 0000000..be09108
--- /dev/null
@@ -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