[flang] Fix length handling in character kind implicit conversion (#74586)
[llvm-project.git] / libc / test / integration / startup / gpu / args_test.cpp
blob1cc5a0e7692796235bb81393069a329a9b148a0f
1 //===-- Loader test to check args to main ---------------------------------===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
9 #include "test/IntegrationTest/test.h"
11 static bool my_streq(const char *lhs, const char *rhs) {
12 const char *l, *r;
13 for (l = lhs, r = rhs; *l != '\0' && *r != '\0'; ++l, ++r)
14 if (*l != *r)
15 return false;
17 return *l == '\0' && *r == '\0';
20 TEST_MAIN(int argc, char **argv, char **envp) {
21 ASSERT_TRUE(argc == 4);
22 ASSERT_TRUE(my_streq(argv[1], "1"));
23 ASSERT_TRUE(my_streq(argv[2], "2"));
24 ASSERT_TRUE(my_streq(argv[3], "3"));
26 bool found_france = false;
27 bool found_germany = false;
28 for (; *envp != nullptr; ++envp) {
29 if (my_streq(*envp, "FRANCE=Paris"))
30 found_france = true;
31 if (my_streq(*envp, "GERMANY=Berlin"))
32 found_germany = true;
35 ASSERT_TRUE(found_france && found_germany);
37 return 0;