Skip to content

Commit c523f98

Browse files
committed
remove unneeded KEEPALIVE in test_ccall
1 parent 9c66347 commit c523f98

1 file changed

Lines changed: 8 additions & 11 deletions

File tree

tests/runner.py

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6841,18 +6841,15 @@ def test_ccall(self):
68416841
src = r'''
68426842
#include <stdio.h>
68436843
6844-
// Optimizations might wipe out our functions without this
6845-
#define KEEPALIVE __attribute__((used))
6846-
68476844
extern "C" {
6848-
int KEEPALIVE get_int() { return 5; }
6849-
float KEEPALIVE get_float() { return 3.14; }
6850-
char * KEEPALIVE get_string() { return "hello world"; }
6851-
void KEEPALIVE print_int(int x) { printf("%d\n", x); }
6852-
void KEEPALIVE print_float(float x) { printf("%.2f\n", x); }
6853-
void KEEPALIVE print_string(char *x) { printf("%s\n", x); }
6854-
int KEEPALIVE multi(int x, float y, int z, char *str) { if (x) puts(str); return (x+y)*z; }
6855-
int * KEEPALIVE pointer(int *in) { printf("%d\n", *in); static int ret = 21; return &ret; }
6845+
int get_int() { return 5; }
6846+
float get_float() { return 3.14; }
6847+
char * get_string() { return "hello world"; }
6848+
void print_int(int x) { printf("%d\n", x); }
6849+
void print_float(float x) { printf("%.2f\n", x); }
6850+
void print_string(char *x) { printf("%s\n", x); }
6851+
int multi(int x, float y, int z, char *str) { if (x) puts(str); return (x+y)*z; }
6852+
int * pointer(int *in) { printf("%d\n", *in); static int ret = 21; return &ret; }
68566853
}
68576854
68586855
int main(int argc, char **argv) {

0 commit comments

Comments
 (0)