File: test-21-safe.cpp

package info (click to toggle)
ikos 3.5-2
  • links: PTS, VCS
  • area: non-free
  • in suites: sid
  • size: 11,896 kB
  • sloc: cpp: 102,890; python: 6,471; ansic: 5,860; sh: 2,409; javascript: 348; makefile: 16
file content (21 lines) | stat: -rw-r--r-- 284 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
// Test that generates array inside structs
#include <stdio.h>

typedef struct {
  float x;
  float y;
} pos_t;

typedef struct {
  pos_t begin;
  pos_t end;
} line_t;

line_t f(float y) {
  return {{0.0, y}, {2.0, 0}};
}

int main() {
  printf("%f\n", f(2.0).begin.y);
  return 0;
}