diff options
Diffstat (limited to 'test/FrontendC')
-rw-r--r-- | test/FrontendC/2006-05-01-AppleAlignmentPragma.c | 2 | ||||
-rw-r--r-- | test/FrontendC/2010-07-27-MinNoFoldConst.c | 2 | ||||
-rw-r--r-- | test/FrontendC/2011-03-02-UnionInitializer.c | 2 | ||||
-rw-r--r-- | test/FrontendC/2011-03-08-ZeroFieldUnionInitializer.c | 7 | ||||
-rw-r--r-- | test/FrontendC/2011-03-31-ArrayRefFolding.c | 15 | ||||
-rw-r--r-- | test/FrontendC/cstring-align.c | 11 | ||||
-rw-r--r-- | test/FrontendC/mmx-inline-asm.c | 24 | ||||
-rw-r--r-- | test/FrontendC/vla-3.c | 11 |
8 files changed, 61 insertions, 13 deletions
diff --git a/test/FrontendC/2006-05-01-AppleAlignmentPragma.c b/test/FrontendC/2006-05-01-AppleAlignmentPragma.c index c9050aa..233968b 100644 --- a/test/FrontendC/2006-05-01-AppleAlignmentPragma.c +++ b/test/FrontendC/2006-05-01-AppleAlignmentPragma.c @@ -1,7 +1,7 @@ // RUN: %llvmgcc %s -S -o - #ifdef __APPLE__ -/* test that X is layed out correctly when this pragma is used. */ +/* test that X is laid out correctly when this pragma is used. */ #pragma options align=mac68k #endif diff --git a/test/FrontendC/2010-07-27-MinNoFoldConst.c b/test/FrontendC/2010-07-27-MinNoFoldConst.c index 7cd8b4c..ea711e5 100644 --- a/test/FrontendC/2010-07-27-MinNoFoldConst.c +++ b/test/FrontendC/2010-07-27-MinNoFoldConst.c @@ -10,7 +10,7 @@ static void bad(unsigned int v1, unsigned int v2) { // MIN(1631381461u * v2 - 4047041419, 1631381461u * v1 - 4047041419) // // 1631381461u * 1273463329u = 2077504466193943669, but 32-bit overflow clips -// this to 4047041419. This breaks the comparision implicit in the MIN(). +// this to 4047041419. This breaks the comparison implicit in the MIN(). // Two multiply operations suggests the bad optimization is happening; // one multiplication, after the MIN(), is correct. // CHECK: mul diff --git a/test/FrontendC/2011-03-02-UnionInitializer.c b/test/FrontendC/2011-03-02-UnionInitializer.c new file mode 100644 index 0000000..a5ea75e --- /dev/null +++ b/test/FrontendC/2011-03-02-UnionInitializer.c @@ -0,0 +1,2 @@ +// RUN: %llvmgcc -S %s +union { int :3; double f; } u17_017 = {17.17}; diff --git a/test/FrontendC/2011-03-08-ZeroFieldUnionInitializer.c b/test/FrontendC/2011-03-08-ZeroFieldUnionInitializer.c new file mode 100644 index 0000000..1fd8a87 --- /dev/null +++ b/test/FrontendC/2011-03-08-ZeroFieldUnionInitializer.c @@ -0,0 +1,7 @@ +// RUN: %llvmgcc -S %s +typedef struct { + union { + struct { } __attribute((packed)); + }; +} fenv_t; +const fenv_t _FE_DFL_ENV = {{{ 0, 0, 0, 0 }}}; diff --git a/test/FrontendC/2011-03-31-ArrayRefFolding.c b/test/FrontendC/2011-03-31-ArrayRefFolding.c new file mode 100644 index 0000000..4039279 --- /dev/null +++ b/test/FrontendC/2011-03-31-ArrayRefFolding.c @@ -0,0 +1,15 @@ +// RUN: %llvmgcc -S -o - -m32 -Os %s | FileCheck %s +// PR9571 + +struct t { + int x; +}; + +extern struct t *cfun; + +int f(void) { + if (!(cfun + 0)) +// CHECK: icmp eq %struct.t* %0, null + return 0; + return cfun->x; +} diff --git a/test/FrontendC/cstring-align.c b/test/FrontendC/cstring-align.c deleted file mode 100644 index 544c9f3..0000000 --- a/test/FrontendC/cstring-align.c +++ /dev/null @@ -1,11 +0,0 @@ -// RUN: %llvmgcc %s -S -Os -o - | llc -march=x86 -mtriple=i386-apple-darwin10 | FileCheck %s - -extern void func(const char *, const char *); - -void long_function_name() { - func("%s: the function name", __func__); -} - -// CHECK: .align 4 -// CHECK: ___func__. -// CHECK: .asciz "long_function_name" diff --git a/test/FrontendC/mmx-inline-asm.c b/test/FrontendC/mmx-inline-asm.c new file mode 100644 index 0000000..b66137c --- /dev/null +++ b/test/FrontendC/mmx-inline-asm.c @@ -0,0 +1,24 @@ +// RUN: %llvmgcc -mmmx -S -o - %s | FileCheck %s +// XFAIL: * +// XTARGET: x86,i386,i686 +// <rdar://problem/9091220> +#include <mmintrin.h> +#include <stdint.h> + +// CHECK: type { x86_mmx, x86_mmx, x86_mmx, x86_mmx, x86_mmx, x86_mmx, x86_mmx } + +void foo(__m64 vfill) { + __m64 v1, v2, v3, v4, v5, v6, v7; + + __asm__ __volatile__ ( + "\tmovq %7, %0\n" + "\tmovq %7, %1\n" + "\tmovq %7, %2\n" + "\tmovq %7, %3\n" + "\tmovq %7, %4\n" + "\tmovq %7, %5\n" + "\tmovq %7, %6" + : "=&y" (v1), "=&y" (v2), "=&y" (v3), + "=&y" (v4), "=&y" (v5), "=&y" (v6), "=y" (v7) + : "y" (vfill)); +} diff --git a/test/FrontendC/vla-3.c b/test/FrontendC/vla-3.c new file mode 100644 index 0000000..eca9675 --- /dev/null +++ b/test/FrontendC/vla-3.c @@ -0,0 +1,11 @@ +// RUN: %llvmgcc -std=gnu99 %s -S -o - | grep ".*alloca.*align 16" + +void adr(char *); + +void vlaalign(int size) +{ + char __attribute__((aligned(16))) tmp[size+32]; + char tmp2[size+16]; + + adr(tmp); +} |