Skip to content

Commit d3468a6

Browse files
committed
tmp: add dg-lto-error
Signed-off-by: Luis Silva <[email protected]>
1 parent 5f0ea4b commit d3468a6

File tree

3 files changed

+28
-2
lines changed

3 files changed

+28
-2
lines changed
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
/* { dg-lto-do link } */
2+
/* { dg-lto-options { { -flto -O2 } } } */
3+
4+
int apex_conflict (int, int);
5+
#pragma intrinsic (apex_conflict, "conflict", 50, "XS")
6+
7+
extern int use_conflict (int, int);
8+
9+
int
10+
main (void)
11+
{
12+
return use_conflict (5, 10);
13+
}
14+
15+
/* { dg-lto-warning "APEX builtin 'apex_conflict' already registered with different opcode: 0x32 vs 0x33" "" { target *-*-* } 0 } */
16+
/* { dg-lto-error "APEX builtin 'apex_conflict' has conflicting definitions across compilation units" "" { target *-*-* } 0 } */
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
2+
int apex_conflict (int, int);
3+
#pragma intrinsic (apex_conflict, "conflict", 51, "XS") /* Different opcode: 51 vs 50 */
4+
5+
int
6+
use_conflict (int a, int b)
7+
{
8+
return apex_conflict (a, b);
9+
}
10+

gcc/testsuite/lib/lto.exp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -407,8 +407,8 @@ proc lto-can-handle-directive { op } {
407407
# A list of directives to recognize, and a list of directives
408408
# to remap them to.
409409
# For example, "dg-lto-warning" is implemented by calling "dg-warning".
410-
set directives { dg-lto-warning dg-lto-message dg-lto-note }
411-
set remapped_directives { dg-warning dg-message dg-note }
410+
set directives { dg-lto-warning dg-lto-message dg-lto-note dg-lto-error }
411+
set remapped_directives { dg-warning dg-message dg-note dg-error }
412412

413413
set idx [lsearch -exact $directives $cmd]
414414
if { $idx != -1 } {

0 commit comments

Comments
 (0)