From 9112829d76cbb8e0c8ef51bbc2d7d1be48cd7b74 Mon Sep 17 00:00:00 2001
From: rdivacky <rdivacky@FreeBSD.org>
Date: Tue, 13 Jul 2010 17:19:57 +0000
Subject: Update LLVM to r108243.

---
 test/FrontendC/2010-05-31-palignr.c         | 24 ++++++++++++++
 test/FrontendC/2010-06-11-SaveExpr.c        |  8 +++++
 test/FrontendC/2010-06-17-asmcrash.c        | 16 +++++++++
 test/FrontendC/2010-06-28-DbgEntryPC.c      | 50 +++++++++++++++++++++++++++++
 test/FrontendC/2010-06-28-DbgLocalVar.c     | 14 ++++++++
 test/FrontendC/2010-06-28-nowarn.c          | 21 ++++++++++++
 test/FrontendC/2010-07-08-DeclDebugLineNo.c | 10 ++++++
 test/FrontendC/pr5406.c                     |  2 +-
 8 files changed, 144 insertions(+), 1 deletion(-)
 create mode 100644 test/FrontendC/2010-05-31-palignr.c
 create mode 100644 test/FrontendC/2010-06-11-SaveExpr.c
 create mode 100644 test/FrontendC/2010-06-17-asmcrash.c
 create mode 100644 test/FrontendC/2010-06-28-DbgEntryPC.c
 create mode 100644 test/FrontendC/2010-06-28-DbgLocalVar.c
 create mode 100644 test/FrontendC/2010-06-28-nowarn.c
 create mode 100644 test/FrontendC/2010-07-08-DeclDebugLineNo.c

(limited to 'test/FrontendC')

diff --git a/test/FrontendC/2010-05-31-palignr.c b/test/FrontendC/2010-05-31-palignr.c
new file mode 100644
index 0000000..9da3145
--- /dev/null
+++ b/test/FrontendC/2010-05-31-palignr.c
@@ -0,0 +1,24 @@
+// RUN: not %llvmgcc -mssse3 -S -o /dev/null %s |& grep "error: mask must be an immediate"
+// XFAIL: *
+// XTARGET: x86,i386,i686
+
+#include <tmmintrin.h>
+
+extern int i;
+
+int main ()
+{
+#if defined( __SSSE3__ )
+
+  typedef int16_t     vSInt16         __attribute__ ((__vector_size__ (16)));
+
+  short   dtbl[] = {1,2,3,4,5,6,7,8};
+  vSInt16 *vdtbl = (vSInt16*) dtbl;
+
+  vSInt16 v0;
+  v0 = *vdtbl;
+  v0 = _mm_alignr_epi8(v0, v0, i);
+
+  return 0;
+#endif
+}
diff --git a/test/FrontendC/2010-06-11-SaveExpr.c b/test/FrontendC/2010-06-11-SaveExpr.c
new file mode 100644
index 0000000..d1c122d
--- /dev/null
+++ b/test/FrontendC/2010-06-11-SaveExpr.c
@@ -0,0 +1,8 @@
+// RUN: %llvmgcc -S %s
+// Test case by Eric Postpischil!
+void foo(void)
+{
+  char a[1];
+  int t = 1;
+  ((char (*)[t]) a)[0][0] = 0;
+}
diff --git a/test/FrontendC/2010-06-17-asmcrash.c b/test/FrontendC/2010-06-17-asmcrash.c
new file mode 100644
index 0000000..5063054
--- /dev/null
+++ b/test/FrontendC/2010-06-17-asmcrash.c
@@ -0,0 +1,16 @@
+// RUN: %llvmgcc -S -o - %s | llc -mtriple=x86_64-apple-darwin | FileCheck %s
+// XFAIL: *
+// XTARGET: x86,i386,i686
+
+typedef long long int64_t;
+typedef unsigned char uint8_t;
+typedef int64_t x86_reg;
+
+void avg_pixels8_mmx2(uint8_t *block, const uint8_t *pixels, int line_size, int h)
+{
+	__asm__ volatile("# %0 %1 %2 %3"
+     :"+g"(h), "+S"(pixels), "+D"(block)
+     :"r" ((x86_reg)line_size)         
+     :"%""rax", "memory");
+// CHECK: # %ecx %rsi %rdi %rdx
+ }
diff --git a/test/FrontendC/2010-06-28-DbgEntryPC.c b/test/FrontendC/2010-06-28-DbgEntryPC.c
new file mode 100644
index 0000000..76a6b51
--- /dev/null
+++ b/test/FrontendC/2010-06-28-DbgEntryPC.c
@@ -0,0 +1,50 @@
+// RUN: %llvmgcc -S -O2 -g %s -o - | llc -O2 -mtriple=i386-apple-darwin | FileCheck %s
+// Use DW_FORM_addr for DW_AT_entry_pc.
+// Radar 8094785
+
+// XFAIL: *
+// XTARGET: x86,i386,i686
+// CHECK:	.byte	17                      ## DW_TAG_compile_unit
+// CHECK-NEXT:	.byte	1                       ## DW_CHILDREN_yes
+// CHECK-NEXT:	.byte	37                      ## DW_AT_producer
+// CHECK-NEXT:	.byte	8                       ## DW_FORM_string
+// CHECK-NEXT:	.byte	19                      ## DW_AT_language
+// CHECK-NEXT:	.byte	11                      ## DW_FORM_data1
+// CHECK-NEXT:	.byte	3                       ## DW_AT_name
+// CHECK-NEXT:	.byte	8                       ## DW_FORM_string
+// CHECK-NEXT:	.byte	82                      ## DW_AT_entry_pc
+// CHECK-NEXT:	.byte	1                       ## DW_FORM_addr
+// CHECK-NEXT:	.byte	16                      ## DW_AT_stmt_list
+// CHECK-NEXT:	.byte	6                       ## DW_FORM_data4
+// CHECK-NEXT:	.byte	27                      ## DW_AT_comp_dir
+// CHECK-NEXT:	.byte	8                       ## DW_FORM_string
+// CHECK-NEXT:	.byte	225                     ## DW_AT_APPLE_optimized
+
+struct a {
+  int c;
+  struct a *d;
+};
+
+int ret;
+
+void foo(int x) __attribute__((noinline));
+void *bar(struct a *b) __attribute__((noinline));
+
+void foo(int x)
+{
+  ret = x;
+}
+
+void *bar(struct a *b) {
+  foo(b->c);
+  return b;
+}
+
+int main(int argc, char *argv[]) {
+  struct a e;
+  e.c = 4;
+  e.d = &e;
+
+  (void)bar(&e);
+  return ret;
+}
diff --git a/test/FrontendC/2010-06-28-DbgLocalVar.c b/test/FrontendC/2010-06-28-DbgLocalVar.c
new file mode 100644
index 0000000..e5df885
--- /dev/null
+++ b/test/FrontendC/2010-06-28-DbgLocalVar.c
@@ -0,0 +1,14 @@
+// RUN: %llvmgcc -S -O2 -g %s -o - | llc -O2 -o %t.s 
+// RUN: grep DW_TAG_structure_type %t.s | count 2
+// Radar 8122864
+
+// Code is not generated for function foo, but preserve type information of
+// local variable xyz.
+static foo() {
+  struct X { int a; int b; } xyz;
+}
+
+int bar() {
+  foo();
+  return 1;
+}
diff --git a/test/FrontendC/2010-06-28-nowarn.c b/test/FrontendC/2010-06-28-nowarn.c
new file mode 100644
index 0000000..9cfb663
--- /dev/null
+++ b/test/FrontendC/2010-06-28-nowarn.c
@@ -0,0 +1,21 @@
+// RUN: %llvmgcc %s -c -m32 -fasm-blocks -o /dev/null
+// This should not warn about unreferenced label. 7729514.
+// XFAIL: *
+// XTARGET: x86,i386,i686
+
+void quarterAsm(int array[], int len)
+{
+  __asm
+  {
+    mov esi, array;
+    mov ecx, len;
+    shr ecx, 2;
+loop:
+    movdqa xmm0, [esi];
+    psrad xmm0, 2;
+    movdqa [esi], xmm0;
+    add esi, 16;
+    sub ecx, 1;
+    jnz loop;
+  }
+}
diff --git a/test/FrontendC/2010-07-08-DeclDebugLineNo.c b/test/FrontendC/2010-07-08-DeclDebugLineNo.c
new file mode 100644
index 0000000..491b7db
--- /dev/null
+++ b/test/FrontendC/2010-07-08-DeclDebugLineNo.c
@@ -0,0 +1,10 @@
+// RUN: %llvmgcc -S -O0 -g %s -o - | FileCheck %s
+// Insure that dbg.declare lines for locals refer to correct line number records.
+// Radar 8152866.
+void foo() {
+  int l = 0;    // line #4: CHECK: {{call.*llvm.dbg.declare.*%l.*\!dbg }}[[variable_l:![0-9]+]]
+  int p = 0;    // line #5: CHECK: {{call.*llvm.dbg.declare.*%p.*\!dbg }}[[variable_p:![0-9]+]]
+}
+// Now match the line number records:
+// CHECK: {{^}}[[variable_l]]{{ = metadata ![{]i32 5,}}
+// CHECK: {{^}}[[variable_p]]{{ = metadata ![{]i32 6,}}
diff --git a/test/FrontendC/pr5406.c b/test/FrontendC/pr5406.c
index c873e51..492bdaf 100644
--- a/test/FrontendC/pr5406.c
+++ b/test/FrontendC/pr5406.c
@@ -8,7 +8,7 @@ typedef struct { char x[3]; } A0;
 void foo (int i, ...);
 
 
-// CHECK: call arm_aapcscc  void (i32, ...)* @foo(i32 1, i32 {{.*}}) nounwind
+// CHECK: call void (i32, ...)* @foo(i32 1, i32 {{.*}}) nounwind
 int main (void)
 {
   A0 a3;
-- 
cgit v1.1