27 lines · cpp
1// RUN: %clangxx -O0 -g %s -o %t && %run %t 2>&1 | FileCheck %s2//3// UNSUPPORTED: darwin, target={{.*(linux|solaris).*}}4 5#include <assert.h>6#include <errno.h>7#include <stdio.h>8#include <string.h>9#include <stringlist.h>10 11int main(void) {12 printf("sl_add\n");13 14 StringList *sl = sl_init();15 assert(sl);16 char *p = strdup("entry");17 assert(!sl_add(sl, p));18 char *entry = sl_find(sl, "entry");19 assert(!strcmp(entry, p));20 printf("Found '%s'\n", entry);21 sl_free(sl, 1);22 23 return 0;24 // CHECK: sl_add25 // CHECK: Found '{{.*}}'26}27