1 /* Test case for strcmp inside a transactionally executing RTM
3 Copyright (C) 2022-2024 Free Software Foundation, Inc.
4 This file is part of the GNU C Library.
6 The GNU C Library is free software; you can redistribute it and/or
7 modify it under the terms of the GNU Lesser General Public
8 License as published by the Free Software Foundation; either
9 version 2.1 of the License, or (at your option) any later version.
11 The GNU C Library is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 Lesser General Public License for more details.
16 You should have received a copy of the GNU Lesser General Public
17 License along with the GNU C Library; if not, see
18 <https://www.gnu.org/licenses/>. */
21 #include <tst-string-rtm.h>
25 # define MEMSET wmemset
26 # define STRCMP wcscmp
27 # define TEST_NAME "wcscmp"
30 # define MEMSET memset
33 # define STRCMP strcmp
34 # define TEST_NAME "strcmp"
39 #define STRING_SIZE 1024
40 CHAR string1
[STRING_SIZE
];
41 CHAR string2
[STRING_SIZE
];
43 __attribute__ ((noinline
, noclone
))
47 MEMSET (string1
, 'a', STRING_SIZE
- 1);
48 MEMSET (string2
, 'a', STRING_SIZE
- 1);
49 if (STRCMP (string1
, string2
) == 0)
55 __attribute__ ((noinline
, noclone
))
59 if (STRCMP (string1
, string2
) == 0)
69 return do_test_1 (TEST_NAME
, LOOP
, prepare
, function
);