mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-12-12 14:06:36 +00:00
Test case for r103800.
llvm-svn: 103801
This commit is contained in:
parent
6517cc1dd9
commit
6bbba26bf1
23
test/FrontendC/2010-05-14-Optimized-VarType.c
Normal file
23
test/FrontendC/2010-05-14-Optimized-VarType.c
Normal file
@ -0,0 +1,23 @@
|
||||
// RUN: %llvmgcc %s -Os -S -g -o - | grep DW_TAG_structure_type | count 1
|
||||
// Variable 'a' is optimized but the debug info should preserve its type info.
|
||||
#include <stdlib.h>
|
||||
|
||||
struct foo {
|
||||
int Attribute;
|
||||
};
|
||||
|
||||
void *getfoo(void) __attribute__((noinline));
|
||||
|
||||
void *getfoo(void)
|
||||
{
|
||||
int *x = malloc(sizeof(int));
|
||||
*x = 42;
|
||||
return (void *)x;
|
||||
}
|
||||
|
||||
int main(int argc, char *argv[]) {
|
||||
struct foo *a = (struct foo *)getfoo();
|
||||
|
||||
return a->Attribute;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user