mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-30 02:32:08 +00:00
552b888744
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103801 91177308-0d34-0410-b5e6-96231b3b80d8
24 lines
440 B
C
24 lines
440 B
C
// 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;
|
|
}
|
|
|