Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
R
riscv-gcc-1
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lvzhengyang
riscv-gcc-1
Commits
f5682f01
Commit
f5682f01
authored
Oct 04, 2016
by
Andre Vieira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add missing testcases from previous patch revision r240379, failed to svn add.
From-SVN: r240746
parent
078b5aab
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
168 additions
and
0 deletions
+168
-0
gcc/testsuite/gcc.target/arm/pure-code/ffunction-sections.c
+17
-0
gcc/testsuite/gcc.target/arm/pure-code/no-casesi.c
+29
-0
gcc/testsuite/gcc.target/arm/pure-code/no-literal-pool.c
+68
-0
gcc/testsuite/gcc.target/arm/pure-code/pure-code.exp
+54
-0
No files found.
gcc/testsuite/gcc.target/arm/pure-code/ffunction-sections.c
0 → 100644
View file @
f5682f01
/* { dg-do compile } */
/* { dg-skip-if "" { *-*-* } { "-fpic" "-fPIC" } { "" } } */
/* { dg-options "-ffunction-sections -mpure-code" } */
#include <limits.h>
char
*
foo
(
void
)
{
return
"foo"
;
}
unsigned
int
bar
(
unsigned
int
b
)
{
return
UINT_MAX
-
b
;
}
/* { dg-final { scan-assembler {\.section\t\.text\.foo[^\n]*\"0x20000006\"} } } */
/* { dg-final { scan-assembler {\.section\t\.text\.bar[^\n]*\"0x20000006\"} } } */
gcc/testsuite/gcc.target/arm/pure-code/no-casesi.c
0 → 100644
View file @
f5682f01
/* { dg-do compile } */
/* { dg-options "-mpure-code" } */
/* { dg-skip-if "" { *-*-* } { "-g" "-fpic" "-fPIC" } { "" } } */
extern
int
foo
(
void
);
extern
int
bar
(
void
);
extern
int
baz
(
void
);
extern
int
fooz
(
void
);
int
caller
(
unsigned
int
reg_type
)
{
switch
(
reg_type
)
{
case
0x80000000
:
return
(
int
)
foo
();
case
0x80000003
:
return
(
int
)
bar
();
case
0x80000001
:
return
(
int
)
baz
();
case
0x80000004
:
return
(
int
)
fooz
();
}
}
/* { dg-final { scan-assembler-not "\\.(float|l\\?double|\d?byte|short|int|long|quad|word)\\s+\[^.\]" } } */
/* { dg-final { scan-assembler "text,\"0x20000006\"" } } */
gcc/testsuite/gcc.target/arm/pure-code/no-literal-pool.c
0 → 100644
View file @
f5682f01
/* { dg-do compile } */
/* { dg-options "-mpure-code" } */
/* { dg-skip-if "" { *-*-* } { "-g" "-fpic" "-fPIC" } { "" } } */
float
sf
;
double
df
;
long
long
l
;
static
char
*
p
=
"Hello World"
;
float
testsf
(
float
*
p
)
{
if
(
*
p
>
1
.
1234
f
)
return
2
.
1234
f
;
else
return
3
.
1234
f
;
}
double
testdf
(
double
*
p
)
{
if
(
*
p
>
4
.
1234
)
return
2
.
1234
;
else
return
3
.
1234
;
}
long
long
testll
(
long
long
*
p
)
{
if
(
*
p
>
0x123456789ABCDEFll
)
return
0x111111111ll
;
else
return
0x222222222ll
;
}
char
*
testchar
()
{
return
p
+
4
;
}
int
foo
(
int
a
,
int
b
)
{
int
i
;
volatile
int
*
labelref
=
&&
label1
;
if
(
a
>
b
)
{
while
(
i
<
b
)
{
a
+=
*
labelref
;
i
+=
1
;
}
goto
*
labelref
;
}
else
b
=
b
+
3
;
a
=
a
*
b
;
label1:
return
a
+
b
;
}
/* { dg-final { scan-assembler-not "\\.(float|l\\?double|\d?byte|short|int|long|quad|word)\\s+\[^.\]" } } */
/* { dg-final { scan-assembler "text,\"0x20000006\"" } } */
gcc/testsuite/gcc.target/arm/pure-code/pure-code.exp
0 → 100644
View file @
f5682f01
# Copyright (C) 1997-2016 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with GCC; see the file COPYING3. If not see
# <http://www.gnu.org/licenses/>.
# GCC testsuite for ARM's -mpure-code option, using the `dg.exp' driver.
# Load support procs.
load_lib gcc-dg.exp
# If a testcase doesn't have special options, use these.
global DEFAULT_CFLAGS
if ![info exists DEFAULT_CFLAGS] then {
set DEFAULT_CFLAGS " -ansi -pedantic-errors"
}
# The -mpure-code option is only available for M-profile targets that support
# thumb2.
if {[check_effective_target_arm_thumb2_ok]
&& ![check_effective_target_arm_arm_ok]} then {
# Initialize `dg'.
dg-init
set saved-dg-do-what-default ${dg-do-what-default}
set dg-do-what-default "assemble"
set saved-lto_torture_options ${LTO_TORTURE_OPTIONS}
# Add -ffat-lto-objects option to all LTO options such that we can do assembly
# scans.
proc add_fat_objects { list } {
set res {}
foreach el $list {set res [lappend res [concat $el " -ffat-lto-objects"]]}
return $res
};
set LTO_TORTURE_OPTIONS [add_fat_objects ${LTO_TORTURE_OPTIONS}]
gcc-dg-runtest [lsort [glob $srcdir/$subdir/*.c]] \
"" $DEFAULT_CFLAGS
# All done.
dg-finish
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment