mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-24 19:52:54 +01:00
Tests for llvm-gcc commit 108360.
llvm-svn: 108362
This commit is contained in:
parent
4a92aee9d6
commit
6c1d01b37c
14
test/FrontendC/2010-07-14-overconservative-align.c
Normal file
14
test/FrontendC/2010-07-14-overconservative-align.c
Normal file
@ -0,0 +1,14 @@
|
||||
// RUN: %llvmgcc %s -emit-llvm -m64 -S -o - | FileCheck %s
|
||||
// PR 5995
|
||||
struct s {
|
||||
int word;
|
||||
struct {
|
||||
int filler __attribute__ ((aligned (8)));
|
||||
};
|
||||
};
|
||||
|
||||
void func (struct s *s)
|
||||
{
|
||||
// CHECK: load %struct.s** %s_addr, align 8
|
||||
s->word = 0;
|
||||
}
|
27
test/FrontendC/2010-07-14-ref-off-end.c
Normal file
27
test/FrontendC/2010-07-14-ref-off-end.c
Normal file
@ -0,0 +1,27 @@
|
||||
// RUN: %llvmgcc %s -S -m32 -o - | FileCheck %s
|
||||
// Formerly this generated code that did a load past the end of the structure.
|
||||
// That was fixed by 46726, but that patch had bad side effects and was
|
||||
// reverted. This has been fixed another way in the meantime.
|
||||
extern void abort();
|
||||
extern void exit(int);
|
||||
struct T
|
||||
{
|
||||
unsigned i:8;
|
||||
unsigned c:24;
|
||||
};
|
||||
f(struct T t)
|
||||
{
|
||||
struct T s[1];
|
||||
s[0]=t;
|
||||
return(char)s->c;
|
||||
}
|
||||
main()
|
||||
{
|
||||
// CHECK: getelementptr inbounds %struct.T* %t, i32 0, i32 0 ; <i32*> [#uses=2]
|
||||
// CHECK: getelementptr inbounds %struct.T* %t, i32 0, i32 0 ; <i32*> [#uses=2]
|
||||
struct T t;
|
||||
t.i=0xff;
|
||||
t.c=0xffff11;
|
||||
if(f(t)!=0x11)abort();
|
||||
exit(0);
|
||||
}
|
Loading…
Reference in New Issue
Block a user