Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Positive tests without flag c from gcc #309

Open
wants to merge 3 commits into
base: feature
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/virtual.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
fetch-depth: 0
- name: Run script
shell: bash
run: ./scripts/test.sh
run: ./scripts/test.sh -d

ubuntu:
name: Ubuntu 20.04
Expand All @@ -26,7 +26,7 @@ jobs:
with:
fetch-depth: 0
- name: Run script
run: ./scripts/test.sh
run: ./scripts/test.sh -d

macos:
name: macOS Big Sur 11
Expand All @@ -39,4 +39,4 @@ jobs:
- name: Set up environment
run: brew install coreutils
- name: Run script
run: ./scripts/test.sh
run: ./scripts/test.sh -d
11 changes: 11 additions & 0 deletions tests/codegen/executable/gcc/20000314-1.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
struct {
char a[5];
} *p;

int main ()
{
int i = -1;

if(p->a[-i])
return 1;
}
32 changes: 32 additions & 0 deletions tests/codegen/executable/gcc/20031214-1.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
/* PR optimization/10312 */
/* Originator: Peter van Hoof <p dot van-hoof at qub dot ac dot uk> */

/* Verify that the strength reduction pass doesn't find
illegitimate givs. */

struct
{
double a;
int n[2];
} g = { 0., { 1, 2}};

int k = 0;

void
b (int *j)
{
}

int
main ()
{
int j;

for (j = 0; j < 2; j++)
k = (k > g.n[j]) ? k : g.n[j];

k++;
b (&j);

return 0;
}
14 changes: 14 additions & 0 deletions tests/codegen/executable/gcc/20040813-1.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/* Test lang in N_SO stab. */
/* Contributed by Devang Patel <[email protected]> */

/* { dg-do compile { target stabs } } */
/* { dg-options "-gstabs" } */

int
main ()
{
return 0;
}

/* { dg-final { scan-assembler ".stabs.*100,0,2" } } */

4 changes: 4 additions & 0 deletions tests/codegen/executable/gcc/20090729_1.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
double j;
int i;
int main () { return i; }

13 changes: 13 additions & 0 deletions tests/codegen/executable/gcc/20090914-1_0.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
/* { dg-lto-do link } */
/* { dg-lto-options {{-flto -g -fvar-tracking-assignments}} } */
/* { dg-suppress-ld-options "-g -fvar-tracking-assignments" } */

void foo()
{
int hex = 0x4;
}

int main()
{
return 0;
}
6 changes: 6 additions & 0 deletions tests/codegen/executable/gcc/20100722-1_0.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/* { dg-lto-do run } */
/* { dg-require-linker-plugin "" } */
/* { dg-extra-ld-options "-fuse-linker-plugin" } */

int main() { return 0; }

3 changes: 3 additions & 0 deletions tests/codegen/executable/gcc/20101009-2_0.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/* { dg-lto-do link } */

int main() { return 0; }
2 changes: 2 additions & 0 deletions tests/codegen/executable/gcc/960218-1.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#define X(x) x
int main() { return X(0/* *//* */); }
23 changes: 23 additions & 0 deletions tests/codegen/executable/gcc/bounds-3.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
/* PR sanitizer/70875 */
/* { dg-do run } */
/* { dg-options "-fsanitize=bounds -fno-sanitize-recover=bounds" } */
/* { dg-shouldfail "ubsan" } */

int
foo (int n, int k)
{
struct S
{
int i[n];
int value;
} s[2];
return s[k].value = 0;
}

int
main ()
{
return foo (2, 2);
}

/* { dg-output "index 2 out of bounds for type 'S \\\[2\\\]'" } */
20 changes: 20 additions & 0 deletions tests/codegen/executable/gcc/call386.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
void foo () {}

int main ()
{
int i;
for (i = 100000; i >= 0; i--)
{
foo ();
foo ();
foo ();
foo ();
foo ();
foo ();
foo ();
foo ();
foo ();
foo ();
}
return 0;
}
22 changes: 22 additions & 0 deletions tests/codegen/executable/gcc/crossmodule-indir-call-topn-1a.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/* It seems there is no way to avoid the other source of mulitple
source testcase from being compiled independently. Just avoid
error. */
#ifdef DOJOB
int
one (int a)
{
return 1;
}

int
two (int a)
{
return 0;
}
#else
int
main()
{
return 0;
}
#endif
15 changes: 15 additions & 0 deletions tests/codegen/executable/gcc/darwin-20040809-2.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
/* Test dead code strip support. */
/* Contributed by Devang Patel <[email protected]> */

/* { dg-do compile { target { *-*-darwin* && stabs } } } */
/* { dg-options "-gstabs+ -fno-eliminate-unused-debug-symbols" } */

int
main ()
{
return 0;
}

/* { dg-final { scan-assembler ".stabd.46,0,0" } } */
/* { dg-final { scan-assembler ".stabd.78,0,0" } } */

11 changes: 11 additions & 0 deletions tests/codegen/executable/gcc/darwin-ld-1.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/* Test Darwin linker option -all_load. */
/* Developed by Devang Patel <[email protected]>. */

/* { dg-options "-all_load" } */
/* { dg-do link { target *-*-darwin* } } */

int main()
{
return 0;
}

11 changes: 11 additions & 0 deletions tests/codegen/executable/gcc/darwin-ld-2.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/* Test Darwin linker option -bind_at_load. */
/* Developed by Devang Patel <[email protected]>. */

/* { dg-options "-bind_at_load" } */
/* { dg-do link { target *-*-darwin* } } */

int main()
{
return 0;
}

13 changes: 13 additions & 0 deletions tests/codegen/executable/gcc/darwin-ld-20040809-1.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
/* Test -dead_strip support. */
/* Contributed by Devang Patel <[email protected]> */

/* { dg-do compile { target *-*-darwin* } } */
/* { dg-options "-dead_strip" } */


int
main ()
{
return 0;
}

12 changes: 12 additions & 0 deletions tests/codegen/executable/gcc/darwin-ld-20040809-2.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/* Test -no_dead_strip_inits_and_terms support. */
/* Contributed by Devang Patel <[email protected]> */

/* { dg-do compile { target *-*-darwin* } } */
/* { dg-options "-no_dead_strip_inits_and_terms" } */

int
main ()
{
return 0;
}

13 changes: 13 additions & 0 deletions tests/codegen/executable/gcc/darwin-ld-20040828-1.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
/* Test -segaddr. */
/* Contributed by Devang Patel <[email protected]> */

/* { dg-do compile { target *-*-darwin* } } */
/* { dg-options "-segaddr __DATA 4000" } */


int
main ()
{
return 0;
}

13 changes: 13 additions & 0 deletions tests/codegen/executable/gcc/darwin-ld-20040828-2.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
/* Test -segs_read_only_addr. */
/* Contributed by Devang Patel <[email protected]> */

/* { dg-do compile { target *-*-darwin* } } */
/* { dg-options "-segs_read_only_addr 4000 -dynamiclib" } */


int
main ()
{
return 0;
}

13 changes: 13 additions & 0 deletions tests/codegen/executable/gcc/darwin-ld-20040828-3.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
/* Test -segs_read_write_addr. */
/* Contributed by Devang Patel <[email protected]> */

/* { dg-do compile { target *-*-darwin* } } */
/* { dg-options "-segs_read_only_addr 4000 -segs_read_write_addr 8000 -dynamiclib" } */


int
main ()
{
return 0;
}

12 changes: 12 additions & 0 deletions tests/codegen/executable/gcc/darwin-ld-3.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@

/* Test Darwin linker option -arch_errors_fatal. */
/* Developed by Devang Patel <[email protected]>. */

/* { dg-options "-arch_errors_fatal" } */
/* { dg-do link { target *-*-darwin* } } */

int main()
{
return 0;
}

11 changes: 11 additions & 0 deletions tests/codegen/executable/gcc/darwin-ld-4.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/* Test Darwin linker option -bundle. */
/* Developed by Devang Patel <[email protected]>. */

/* { dg-options "-bundle" } */
/* { dg-do link { target *-*-darwin* } } */

int main()
{
return 0;
}

11 changes: 11 additions & 0 deletions tests/codegen/executable/gcc/darwin-ld-5.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/* Test Darwin linker option -dynamic. */
/* Developed by Devang Patel <[email protected]>. */

/* { dg-options "-dynamic" } */
/* { dg-do link { target *-*-darwin* } } */

int main()
{
return 0;
}

16 changes: 16 additions & 0 deletions tests/codegen/executable/gcc/darwin-version-1.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
/* Basic test of the -mmacosx-version-min option. */

/* Darwin4 corresponds to MacOS 10.0. */
/* { dg-options "-mmacosx-version-min=10.1" { target *-*-darwin[456789]* } } */
/* Later Darwin linkers decline to link for less than Darwin8/MacOS 10.4.
However, we need to make the link for 10.6 because the relevant libgcc_s
shim files for 10.4 and 10.5 are also not installed in later SDKs. */
/* { dg-options "-mmacosx-version-min=10.6" { target *-*-darwin1[01234567]* } } */
/* From XCode 11.4 on 10.14/15 10.6 and 10.7 are also deprecated. */
/* { dg-options "-mmacosx-version-min=10.8" { target *-*-darwin1[89]* } } */
/* { dg-do link { target *-*-darwin* } } */

int main()
{
return 0;
}
13 changes: 13 additions & 0 deletions tests/codegen/executable/gcc/dev-specific-rmw.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
/* Verify that rmw instructions supported */
/* { dg-do assemble } */

int main()
{
#ifdef __AVR_ISA_RMW__
__asm("xch Z, r12");
__asm("las Z, r12");
__asm("lac Z, r12");
__asm("lat Z, r12");
#endif
return 0;
}
7 changes: 7 additions & 0 deletions tests/codegen/executable/gcc/devnull-dump.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/* { dg-do assemble } */
/* { dg-options "-fdump-ipa-clones -o /dev/null" } */

int main()
{
return 0;
}
8 changes: 8 additions & 0 deletions tests/codegen/executable/gcc/dg-bogus-exp-P.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/* Test the tester; previously part of gcc.misc-tests/dg-9.c. */
/* { dg-prms-id 42 } */
/* { dg-options "-Wall" } */

int main (int argc, char *argv[])
{
return 0; /* { dg-bogus "foobar" "bogus fail test" } */
}
8 changes: 8 additions & 0 deletions tests/codegen/executable/gcc/dg-do-run-sf-exp-F.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/* { dg-do run } */
/* { dg-shouldfail "required comment" } */

int
main ()
{
return 0; /* We expect nonzero, so this fails. */
}
9 changes: 9 additions & 0 deletions tests/codegen/executable/gcc/dg-do-run-xrif-nocache-exp-XF.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/* { dg-do run } */
/* { dg-options "-DDEFINED" } */
/* { dg-xfail-run-if "comment" { def_nocache } } */

int
main ()
{
return 1;
}
Loading