Skip to content

Commit 918a4ef

Browse files
Add failing test
1 parent e4f4445 commit 918a4ef

File tree

2 files changed

+25
-0
lines changed

2 files changed

+25
-0
lines changed

test/small1/c99-tgmath2.c

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#include <stdio.h>
2+
#include <tgmath.h>
3+
#include <complex.h>
4+
#include "testharness.h"
5+
6+
typedef struct loc_t
7+
{
8+
long nloc;
9+
} loc_t;
10+
11+
12+
void fun(const loc_t* loc) {
13+
long l;
14+
int n0 =(int)sqrt(l); // works
15+
int n1 =(int)sqrt(loc->nloc); // fails
16+
}
17+
18+
19+
int main() {
20+
loc_t loc;
21+
loc.nloc = 5;
22+
loc_t* ptr = &loc;
23+
fun(ptr);
24+
}

test/testcil.pl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -695,6 +695,7 @@ sub addToGroup {
695695
addTest("testrunc99/c99-universal-character-names");
696696

697697
addTest("testrunc99/c99-tgmath");
698+
addTest("testrunc99/c99-tgmath2");
698699
addTest("testrunc99/c99-float-pragma");
699700
addTest("testrunc99/c99-fixed-width-int");
700701
addTest("combinec99inline");

0 commit comments

Comments
 (0)