Fixed some bugs.
[llvm/zpu.git] / test / FrontendC / 2010-05-14-Optimized-VarType.c
blob2aa85b5846eaf6aa5a78f5930544361ce75d411b
1 // RUN: %llvmgcc %s -Os -S -g -o - | grep DW_TAG_structure_type | count 1
2 // Variable 'a' is optimized but the debug info should preserve its type info.
3 #include <stdlib.h>
5 struct foo {
6 int Attribute;
7 };
9 void *getfoo(void) __attribute__((noinline));
11 void *getfoo(void)
13 int *x = malloc(sizeof(int));
14 *x = 42;
15 return (void *)x;
18 int main(int argc, char *argv[]) {
19 struct foo *a = (struct foo *)getfoo();
21 return a->Attribute;