new testcase
authorChris Lattner <sabre@nondot.org>
Sun, 9 Nov 2003 00:23:05 +0000 (00:23 +0000)
committerChris Lattner <sabre@nondot.org>
Sun, 9 Nov 2003 00:23:05 +0000 (00:23 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9817 91177308-0d34-0410-b5e6-96231b3b80d8

test/CFrontend/2003-11-04-EmptyStruct.c
test/CFrontend/2003-11-08-PointerSubNotGetelementptr.c.tr [new file with mode: 0644]

index 48d089e247989e5fc0f89106964dd64d13c05304..f8b8f5f48f7c5301e54ef2b0da6a80b09c56113a 100644 (file)
@@ -2,4 +2,3 @@ typedef struct { } rwlock_t;
 struct fs_struct { rwlock_t lock; int umask; };
 void __copy_fs_struct(struct fs_struct *fs) { fs->lock = (rwlock_t) { }; }
 
-
diff --git a/test/CFrontend/2003-11-08-PointerSubNotGetelementptr.c.tr b/test/CFrontend/2003-11-08-PointerSubNotGetelementptr.c.tr
new file mode 100644 (file)
index 0000000..443dfbd
--- /dev/null
@@ -0,0 +1,9 @@
+// RUN: %llvmgcc -xc %s -c -o - | llvm-dis | grep getelementptr
+
+char *test(char* C) {
+  return C-1;   // Should turn into a GEP
+}
+
+int *test2(int* I) {
+  return I-1;
+}