Skip to content

[C2y] Claim conformance and add test coverage for WG14 N3346 #115516

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

Merged
merged 1 commit into from
Nov 8, 2024

Conversation

AaronBallman
Copy link
Collaborator

This converts some undefined behaviors during initialization to instead be constraint violations. Clang has always implemented these as constraints, so no compiler changes were needed.

This converts some undefined behaviors during initialization to instead
be constraint violations. Clang has always implemented these as
constraints, so no compiler changes were needed.
@llvmbot llvmbot added the clang Clang issues not falling into any other category label Nov 8, 2024
@llvmbot
Copy link
Member

llvmbot commented Nov 8, 2024

@llvm/pr-subscribers-clang

Author: Aaron Ballman (AaronBallman)

Changes

This converts some undefined behaviors during initialization to instead be constraint violations. Clang has always implemented these as constraints, so no compiler changes were needed.


Full diff: https://github.com/llvm/llvm-project/pull/115516.diff

3 Files Affected:

  • (modified) clang/docs/ReleaseNotes.rst (+5)
  • (added) clang/test/C/C2y/n3346.c (+68)
  • (modified) clang/www/c_status.html (+1-1)
diff --git a/clang/docs/ReleaseNotes.rst b/clang/docs/ReleaseNotes.rst
index d4bf05651a63eb..77ba5f1d79bcdb 100644
--- a/clang/docs/ReleaseNotes.rst
+++ b/clang/docs/ReleaseNotes.rst
@@ -303,6 +303,11 @@ C2y Feature Support
   undefined. Clang has always accepted ``const`` and ``volatile`` qualified
   function types by ignoring the qualifiers.
 
+- Updated conformance for `N3346 <https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3346.pdf>`_
+  which changes some undefined behavior around initialization to instead be
+  constraint violations. This paper adopts Clang's existing practice, so there
+  were no changes to compiler behavior.
+
 C23 Feature Support
 ^^^^^^^^^^^^^^^^^^^
 
diff --git a/clang/test/C/C2y/n3346.c b/clang/test/C/C2y/n3346.c
new file mode 100644
index 00000000000000..2f0ef51d56fb76
--- /dev/null
+++ b/clang/test/C/C2y/n3346.c
@@ -0,0 +1,68 @@
+// RUN: %clang_cc1 -verify -std=c2y -Wall -pedantic -ffreestanding %s
+// RUN: %clang_cc1 -verify=expected,ped -Wall -pedantic -ffreestanding %s
+
+/* WG14 N3346: Yes
+ * Slay Some Earthly Demons VIII
+ *
+ * Updates some undefined behavior during initialization to instead be a
+ * constraint violation.
+ */
+
+// The initializer for a scalar shall be a single expression, optionally
+// enclosed in braces, or it shall be an empty initializer.
+int i = 12, j = {12}, k = {}; // ped-warning {{use of an empty initializer is a C23 extension}}
+
+struct S {
+  int i;
+  float f;
+  int : 0;
+  char c;
+};
+
+void test1(void) {
+  // The initializer for an object that has structure or union type shall be
+  // either a single expression that has compatible type or a brace-enclosed
+  // list of initializers for the elements or named members.
+  struct S s1 = { 1, 1.2f, 'a' };
+  struct S s2 = s1;
+
+  // Despite being structurally identical to S, T is not compatible with S.
+  struct T { int i; float f; int : 0; char c; } t;
+  struct S s3 = t; // expected-error {{initializing 'struct S' with an expression of incompatible type 'struct T'}}
+}
+
+void test2(void) {
+  typedef __WCHAR_TYPE__ wchar_t;
+  typedef __CHAR16_TYPE__ char16_t;
+  typedef __CHAR32_TYPE__ char32_t;
+
+  // The initializer for an array shall be either a string literal, optionally
+  // enclosed in braces, or a brace-enclosed list of initializers for the
+  // elements. An array initialized by character string literal or UTF-8 string
+  // literal shall have a character type as element type. An array initialized
+  // with a wide string literal shall have element type compatible with a
+  // qualified or unqualified wchar_t, char16_t, or char32_t, and the string
+  // literal shall have the corresponding encoding prefix (L, u, or U,
+  // respectively).
+  char str1[] = "string literal";
+  char str2[] = { "string literal" };
+  char str3[] = u8"string literal";
+  char str4[] = { u8"string literal" };
+
+  int str5[] = "this doesn't work";          // expected-error {{array initializer must be an initializer list}}
+  int str6[] = { "this also doesn't work" }; // expected-error {{incompatible pointer to integer conversion initializing 'int' with an expression of type 'char[23]'}}
+
+  wchar_t str7[] = L"string literal";
+  wchar_t str8[] = { L"string literal" };
+  char16_t str9[] = u"string literal";
+  char16_t str10[] = { u"string literal" };
+  char32_t str11[] = U"string literal";
+  char32_t str12[] = { U"string literal" };
+
+  wchar_t str13[] = "nope";      // expected-error {{initializing wide char array with non-wide string literal}}
+  wchar_t str14[] = { "nope" };  // expected-error-re {{incompatible pointer to integer conversion initializing 'wchar_t' (aka '{{.*}}') with an expression of type 'char[5]'}}
+  char16_t str15[] = "nope";     // expected-error {{initializing wide char array with non-wide string literal}}
+  char16_t str16[] = { "nope" }; // expected-error-re {{incompatible pointer to integer conversion initializing 'char16_t' (aka '{{.*}}') with an expression of type 'char[5]'}}
+  char32_t str17[] = "nope";     // expected-error {{initializing wide char array with non-wide string literal}}
+  char32_t str18[] = { "nope" }; // expected-error-re {{incompatible pointer to integer conversion initializing 'char32_t' (aka '{{.*}}') with an expression of type 'char[5]'}}
+}
diff --git a/clang/www/c_status.html b/clang/www/c_status.html
index fa2411e674d768..663cc2e33f5157 100644
--- a/clang/www/c_status.html
+++ b/clang/www/c_status.html
@@ -211,7 +211,7 @@ <h2 id="c2y">C2y implementation status</h2>
     <tr>
       <td>Slay Some Earthly Demons VIII</td>
       <td><a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3346.pdf">N3346</a></td>
-      <td class="unknown" align="center">Unknown</td>
+      <td class="full" align="center">Yes</td>
     </tr>
     <tr>
       <td>Introduce complex literals v. 2</td>

@AaronBallman AaronBallman merged commit c3c2f46 into llvm:main Nov 8, 2024
11 of 12 checks passed
@AaronBallman AaronBallman deleted the aballman-wg14-n3346 branch November 8, 2024 17:43
@llvm-ci
Copy link
Collaborator

llvm-ci commented Nov 8, 2024

LLVM Buildbot has detected a new failure on builder llvm-clang-x86_64-sie-ubuntu-fast running on sie-linux-worker while building clang at step 6 "test-build-unified-tree-check-all".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/144/builds/11198

Here is the relevant piece of the build log for the reference
Step 6 (test-build-unified-tree-check-all) failure: test (failure)
******************** TEST 'Clang :: C/C2y/n3346.c' FAILED ********************
Exit Code: 1

Command Output (stderr):
--
RUN: at line 1: /home/buildbot/buildbot-root/llvm-clang-x86_64-sie-ubuntu-fast/build/bin/clang -cc1 -internal-isystem /home/buildbot/buildbot-root/llvm-clang-x86_64-sie-ubuntu-fast/build/lib/clang/20/include -nostdsysteminc -verify -std=c2y -Wall -pedantic -ffreestanding /home/buildbot/buildbot-root/llvm-clang-x86_64-sie-ubuntu-fast/llvm-project/clang/test/C/C2y/n3346.c
+ /home/buildbot/buildbot-root/llvm-clang-x86_64-sie-ubuntu-fast/build/bin/clang -cc1 -internal-isystem /home/buildbot/buildbot-root/llvm-clang-x86_64-sie-ubuntu-fast/build/lib/clang/20/include -nostdsysteminc -verify -std=c2y -Wall -pedantic -ffreestanding /home/buildbot/buildbot-root/llvm-clang-x86_64-sie-ubuntu-fast/llvm-project/clang/test/C/C2y/n3346.c
RUN: at line 2: /home/buildbot/buildbot-root/llvm-clang-x86_64-sie-ubuntu-fast/build/bin/clang -cc1 -internal-isystem /home/buildbot/buildbot-root/llvm-clang-x86_64-sie-ubuntu-fast/build/lib/clang/20/include -nostdsysteminc -verify=expected,ped -Wall -pedantic -ffreestanding /home/buildbot/buildbot-root/llvm-clang-x86_64-sie-ubuntu-fast/llvm-project/clang/test/C/C2y/n3346.c
+ /home/buildbot/buildbot-root/llvm-clang-x86_64-sie-ubuntu-fast/build/bin/clang -cc1 -internal-isystem /home/buildbot/buildbot-root/llvm-clang-x86_64-sie-ubuntu-fast/build/lib/clang/20/include -nostdsysteminc -verify=expected,ped -Wall -pedantic -ffreestanding /home/buildbot/buildbot-root/llvm-clang-x86_64-sie-ubuntu-fast/llvm-project/clang/test/C/C2y/n3346.c
error: 'expected-error' diagnostics expected but not seen: 
  File /home/buildbot/buildbot-root/llvm-clang-x86_64-sie-ubuntu-fast/llvm-project/clang/test/C/C2y/n3346.c Line 66: initializing wide char array with non-wide string literal
error: 'expected-error' diagnostics seen but not expected: 
  File /home/buildbot/buildbot-root/llvm-clang-x86_64-sie-ubuntu-fast/llvm-project/clang/test/C/C2y/n3346.c Line 49: use of undeclared identifier 'u8'
  File /home/buildbot/buildbot-root/llvm-clang-x86_64-sie-ubuntu-fast/llvm-project/clang/test/C/C2y/n3346.c Line 49: expected ';' at end of declaration
  File /home/buildbot/buildbot-root/llvm-clang-x86_64-sie-ubuntu-fast/llvm-project/clang/test/C/C2y/n3346.c Line 50: use of undeclared identifier 'u8'
  File /home/buildbot/buildbot-root/llvm-clang-x86_64-sie-ubuntu-fast/llvm-project/clang/test/C/C2y/n3346.c Line 57: use of undeclared identifier 'u'
  File /home/buildbot/buildbot-root/llvm-clang-x86_64-sie-ubuntu-fast/llvm-project/clang/test/C/C2y/n3346.c Line 57: expected ';' at end of declaration
  File /home/buildbot/buildbot-root/llvm-clang-x86_64-sie-ubuntu-fast/llvm-project/clang/test/C/C2y/n3346.c Line 58: use of undeclared identifier 'u'
  File /home/buildbot/buildbot-root/llvm-clang-x86_64-sie-ubuntu-fast/llvm-project/clang/test/C/C2y/n3346.c Line 59: use of undeclared identifier 'U'
  File /home/buildbot/buildbot-root/llvm-clang-x86_64-sie-ubuntu-fast/llvm-project/clang/test/C/C2y/n3346.c Line 59: expected ';' at end of declaration
  File /home/buildbot/buildbot-root/llvm-clang-x86_64-sie-ubuntu-fast/llvm-project/clang/test/C/C2y/n3346.c Line 60: use of undeclared identifier 'U'
  File /home/buildbot/buildbot-root/llvm-clang-x86_64-sie-ubuntu-fast/llvm-project/clang/test/C/C2y/n3346.c Line 66: array initializer must be an initializer list
11 errors generated.

--

********************


@llvm-ci
Copy link
Collaborator

llvm-ci commented Nov 8, 2024

LLVM Buildbot has detected a new failure on builder clang-ve-ninja running on hpce-ve-main while building clang at step 4 "annotate".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/12/builds/9226

Here is the relevant piece of the build log for the reference
Step 4 (annotate) failure: 'python ../llvm-zorg/zorg/buildbot/builders/annotated/ve-linux.py ...' (failure)
...
[295/301] Linking CXX executable tools/clang/unittests/Driver/ClangDriverTests
[296/301] Linking CXX executable tools/clang/unittests/CodeGen/ClangCodeGenTests
[297/301] Linking CXX executable tools/clang/unittests/Tooling/ToolingTests
[298/301] Linking CXX executable tools/clang/unittests/Frontend/FrontendTests
[299/301] Linking CXX executable tools/clang/unittests/Interpreter/ExceptionTests/ClangReplInterpreterExceptionTests
[300/301] Linking CXX executable tools/clang/unittests/Interpreter/ClangReplInterpreterTests
[300/301] Running the Clang regression tests
-- Testing: 21274 tests, 48 workers --
llvm-lit: /scratch/buildbot/bothome/clang-ve-ninja/llvm-project/llvm/utils/lit/lit/llvm/config.py:506: note: using clang: /scratch/buildbot/bothome/clang-ve-ninja/build/build_llvm/bin/clang
Testing:  0.
FAIL: Clang :: C/C2y/n3346.c (1501 of 21274)
******************** TEST 'Clang :: C/C2y/n3346.c' FAILED ********************
Exit Code: 1

Command Output (stderr):
--
RUN: at line 1: /scratch/buildbot/bothome/clang-ve-ninja/build/build_llvm/bin/clang -cc1 -internal-isystem /scratch/buildbot/bothome/clang-ve-ninja/build/build_llvm/lib/clang/20/include -nostdsysteminc -verify -std=c2y -Wall -pedantic -ffreestanding /scratch/buildbot/bothome/clang-ve-ninja/llvm-project/clang/test/C/C2y/n3346.c
+ /scratch/buildbot/bothome/clang-ve-ninja/build/build_llvm/bin/clang -cc1 -internal-isystem /scratch/buildbot/bothome/clang-ve-ninja/build/build_llvm/lib/clang/20/include -nostdsysteminc -verify -std=c2y -Wall -pedantic -ffreestanding /scratch/buildbot/bothome/clang-ve-ninja/llvm-project/clang/test/C/C2y/n3346.c
error: 'expected-error' diagnostics expected but not seen: 
  File /scratch/buildbot/bothome/clang-ve-ninja/llvm-project/clang/test/C/C2y/n3346.c Line 52: array initializer must be an initializer list
error: 'expected-error' diagnostics seen but not expected: 
  File /scratch/buildbot/bothome/clang-ve-ninja/llvm-project/clang/test/C/C2y/n3346.c Line 52: initializing wide char array with non-wide string literal
2 errors generated.

--

********************
Testing:  0.. 10.. 20.. 30.. 40.. 50.. 60.. 70.. 80.. 90.. 
********************
Failed Tests (1):
  Clang :: C/C2y/n3346.c


Testing Time: 52.55s

Total Discovered Tests: 45589
  Skipped          :    10 (0.02%)
  Unsupported      :  3798 (8.33%)
  Passed           : 41754 (91.59%)
  Expectedly Failed:    26 (0.06%)
  Failed           :     1 (0.00%)
FAILED: tools/clang/test/CMakeFiles/check-clang /scratch/buildbot/bothome/clang-ve-ninja/build/build_llvm/tools/clang/test/CMakeFiles/check-clang 
cd /scratch/buildbot/bothome/clang-ve-ninja/build/build_llvm/tools/clang/test && /home/buildbot/sandbox/bin/python3 /scratch/buildbot/bothome/clang-ve-ninja/build/build_llvm/./bin/llvm-lit -sv --param USE_Z3_SOLVER=0 /scratch/buildbot/bothome/clang-ve-ninja/build/build_llvm/tools/clang/test
ninja: build stopped: subcommand failed.
make: *** [check-llvm] Error 1
['make', '-f', '/scratch/buildbot/bothome/clang-ve-ninja/llvm-zorg/zorg/buildbot/builders/annotated/ve-linux-steps.make', 'check-llvm', 'BUILDROOT=/scratch/buildbot/bothome/clang-ve-ninja/build'] exited with return code 2.
The build step threw an exception...
Traceback (most recent call last):
  File "../llvm-zorg/zorg/buildbot/builders/annotated/ve-linux.py", line 47, in step
Step 8 (check-llvm) failure: check-llvm (failure)
...
[295/301] Linking CXX executable tools/clang/unittests/Driver/ClangDriverTests
[296/301] Linking CXX executable tools/clang/unittests/CodeGen/ClangCodeGenTests
[297/301] Linking CXX executable tools/clang/unittests/Tooling/ToolingTests
[298/301] Linking CXX executable tools/clang/unittests/Frontend/FrontendTests
[299/301] Linking CXX executable tools/clang/unittests/Interpreter/ExceptionTests/ClangReplInterpreterExceptionTests
[300/301] Linking CXX executable tools/clang/unittests/Interpreter/ClangReplInterpreterTests
[300/301] Running the Clang regression tests
-- Testing: 21274 tests, 48 workers --
llvm-lit: /scratch/buildbot/bothome/clang-ve-ninja/llvm-project/llvm/utils/lit/lit/llvm/config.py:506: note: using clang: /scratch/buildbot/bothome/clang-ve-ninja/build/build_llvm/bin/clang
Testing:  0.
FAIL: Clang :: C/C2y/n3346.c (1501 of 21274)
******************** TEST 'Clang :: C/C2y/n3346.c' FAILED ********************
Exit Code: 1

Command Output (stderr):
--
RUN: at line 1: /scratch/buildbot/bothome/clang-ve-ninja/build/build_llvm/bin/clang -cc1 -internal-isystem /scratch/buildbot/bothome/clang-ve-ninja/build/build_llvm/lib/clang/20/include -nostdsysteminc -verify -std=c2y -Wall -pedantic -ffreestanding /scratch/buildbot/bothome/clang-ve-ninja/llvm-project/clang/test/C/C2y/n3346.c
+ /scratch/buildbot/bothome/clang-ve-ninja/build/build_llvm/bin/clang -cc1 -internal-isystem /scratch/buildbot/bothome/clang-ve-ninja/build/build_llvm/lib/clang/20/include -nostdsysteminc -verify -std=c2y -Wall -pedantic -ffreestanding /scratch/buildbot/bothome/clang-ve-ninja/llvm-project/clang/test/C/C2y/n3346.c
error: 'expected-error' diagnostics expected but not seen: 
  File /scratch/buildbot/bothome/clang-ve-ninja/llvm-project/clang/test/C/C2y/n3346.c Line 52: array initializer must be an initializer list
error: 'expected-error' diagnostics seen but not expected: 
  File /scratch/buildbot/bothome/clang-ve-ninja/llvm-project/clang/test/C/C2y/n3346.c Line 52: initializing wide char array with non-wide string literal
2 errors generated.

--

********************
Testing:  0.. 10.. 20.. 30.. 40.. 50.. 60.. 70.. 80.. 90.. 
********************
Failed Tests (1):
  Clang :: C/C2y/n3346.c


Testing Time: 52.55s

Total Discovered Tests: 45589
  Skipped          :    10 (0.02%)
  Unsupported      :  3798 (8.33%)
  Passed           : 41754 (91.59%)
  Expectedly Failed:    26 (0.06%)
  Failed           :     1 (0.00%)
FAILED: tools/clang/test/CMakeFiles/check-clang /scratch/buildbot/bothome/clang-ve-ninja/build/build_llvm/tools/clang/test/CMakeFiles/check-clang 
cd /scratch/buildbot/bothome/clang-ve-ninja/build/build_llvm/tools/clang/test && /home/buildbot/sandbox/bin/python3 /scratch/buildbot/bothome/clang-ve-ninja/build/build_llvm/./bin/llvm-lit -sv --param USE_Z3_SOLVER=0 /scratch/buildbot/bothome/clang-ve-ninja/build/build_llvm/tools/clang/test
ninja: build stopped: subcommand failed.
make: *** [check-llvm] Error 1
['make', '-f', '/scratch/buildbot/bothome/clang-ve-ninja/llvm-zorg/zorg/buildbot/builders/annotated/ve-linux-steps.make', 'check-llvm', 'BUILDROOT=/scratch/buildbot/bothome/clang-ve-ninja/build'] exited with return code 2.
The build step threw an exception...
Traceback (most recent call last):
  File "../llvm-zorg/zorg/buildbot/builders/annotated/ve-linux.py", line 47, in step

@llvm-ci
Copy link
Collaborator

llvm-ci commented Nov 8, 2024

LLVM Buildbot has detected a new failure on builder openmp-offload-sles-build-only running on rocm-worker-hw-04-sles while building clang at step 6 "Add check check-clang".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/140/builds/10487

Here is the relevant piece of the build log for the reference
Step 6 (Add check check-clang) failure: test (failure)
******************** TEST 'Clang :: C/C2y/n3346.c' FAILED ********************
Exit Code: 1

Command Output (stderr):
--
RUN: at line 1: /home/botworker/bbot/builds/openmp-offload-sles-build/llvm.build/bin/clang -cc1 -internal-isystem /home/botworker/bbot/builds/openmp-offload-sles-build/llvm.build/lib/clang/20/include -nostdsysteminc -verify -std=c2y -Wall -pedantic -ffreestanding /home/botworker/bbot/builds/openmp-offload-sles-build/llvm.src/clang/test/C/C2y/n3346.c
+ /home/botworker/bbot/builds/openmp-offload-sles-build/llvm.build/bin/clang -cc1 -internal-isystem /home/botworker/bbot/builds/openmp-offload-sles-build/llvm.build/lib/clang/20/include -nostdsysteminc -verify -std=c2y -Wall -pedantic -ffreestanding /home/botworker/bbot/builds/openmp-offload-sles-build/llvm.src/clang/test/C/C2y/n3346.c
error: 'expected-error' diagnostics expected but not seen: 
  File /home/botworker/bbot/builds/openmp-offload-sles-build/llvm.src/clang/test/C/C2y/n3346.c Line 52: array initializer must be an initializer list
error: 'expected-error' diagnostics seen but not expected: 
  File /home/botworker/bbot/builds/openmp-offload-sles-build/llvm.src/clang/test/C/C2y/n3346.c Line 52: initializing wide char array with non-wide string literal
2 errors generated.

--

********************


@llvm-ci
Copy link
Collaborator

llvm-ci commented Nov 8, 2024

LLVM Buildbot has detected a new failure on builder clang-m68k-linux-cross running on suse-gary-m68k-cross while building clang at step 5 "ninja check 1".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/27/builds/1752

Here is the relevant piece of the build log for the reference
Step 5 (ninja check 1) failure: stage 1 checked (failure)
******************** TEST 'Clang :: C/C2y/n3346.c' FAILED ********************
Exit Code: 1

Command Output (stderr):
--
RUN: at line 1: /var/lib/buildbot/workers/suse-gary-m68k-cross/clang-m68k-linux-cross/stage1/bin/clang -cc1 -internal-isystem /var/lib/buildbot/workers/suse-gary-m68k-cross/clang-m68k-linux-cross/stage1/lib/clang/20/include -nostdsysteminc -verify -std=c2y -Wall -pedantic -ffreestanding /var/lib/buildbot/workers/suse-gary-m68k-cross/clang-m68k-linux-cross/llvm/clang/test/C/C2y/n3346.c
+ /var/lib/buildbot/workers/suse-gary-m68k-cross/clang-m68k-linux-cross/stage1/bin/clang -cc1 -internal-isystem /var/lib/buildbot/workers/suse-gary-m68k-cross/clang-m68k-linux-cross/stage1/lib/clang/20/include -nostdsysteminc -verify -std=c2y -Wall -pedantic -ffreestanding /var/lib/buildbot/workers/suse-gary-m68k-cross/clang-m68k-linux-cross/llvm/clang/test/C/C2y/n3346.c
error: 'expected-error' diagnostics expected but not seen: 
  File /var/lib/buildbot/workers/suse-gary-m68k-cross/clang-m68k-linux-cross/llvm/clang/test/C/C2y/n3346.c Line 52: array initializer must be an initializer list
error: 'expected-error' diagnostics seen but not expected: 
  File /var/lib/buildbot/workers/suse-gary-m68k-cross/clang-m68k-linux-cross/llvm/clang/test/C/C2y/n3346.c Line 52: initializing wide char array with non-wide string literal
2 errors generated.

--

********************


@llvm-ci
Copy link
Collaborator

llvm-ci commented Nov 8, 2024

LLVM Buildbot has detected a new failure on builder clang-cmake-x86_64-avx512-linux running on avx512-intel64 while building clang at step 7 "ninja check 1".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/133/builds/6505

Here is the relevant piece of the build log for the reference
Step 7 (ninja check 1) failure: stage 1 checked (failure)
******************** TEST 'Clang :: C/C2y/n3346.c' FAILED ********************
Exit Code: 1

Command Output (stderr):
--
RUN: at line 1: /localdisk2/buildbot/llvm-worker/clang-cmake-x86_64-avx512-linux/stage1/bin/clang -cc1 -internal-isystem /localdisk2/buildbot/llvm-worker/clang-cmake-x86_64-avx512-linux/stage1/lib/clang/20/include -nostdsysteminc -verify -std=c2y -Wall -pedantic -ffreestanding /localdisk2/buildbot/llvm-worker/clang-cmake-x86_64-avx512-linux/llvm/clang/test/C/C2y/n3346.c
+ /localdisk2/buildbot/llvm-worker/clang-cmake-x86_64-avx512-linux/stage1/bin/clang -cc1 -internal-isystem /localdisk2/buildbot/llvm-worker/clang-cmake-x86_64-avx512-linux/stage1/lib/clang/20/include -nostdsysteminc -verify -std=c2y -Wall -pedantic -ffreestanding /localdisk2/buildbot/llvm-worker/clang-cmake-x86_64-avx512-linux/llvm/clang/test/C/C2y/n3346.c
error: 'expected-error' diagnostics expected but not seen: 
  File /localdisk2/buildbot/llvm-worker/clang-cmake-x86_64-avx512-linux/llvm/clang/test/C/C2y/n3346.c Line 52: array initializer must be an initializer list
error: 'expected-error' diagnostics seen but not expected: 
  File /localdisk2/buildbot/llvm-worker/clang-cmake-x86_64-avx512-linux/llvm/clang/test/C/C2y/n3346.c Line 52: initializing wide char array with non-wide string literal
2 errors generated.

--

********************


@llvm-ci
Copy link
Collaborator

llvm-ci commented Nov 8, 2024

LLVM Buildbot has detected a new failure on builder llvm-clang-x86_64-gcc-ubuntu running on sie-linux-worker3 while building clang at step 6 "test-build-unified-tree-check-all".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/174/builds/8131

Here is the relevant piece of the build log for the reference
Step 6 (test-build-unified-tree-check-all) failure: test (failure)
******************** TEST 'Clang :: C/C2y/n3346.c' FAILED ********************
Exit Code: 1

Command Output (stderr):
--
RUN: at line 1: /home/buildbot/buildbot-root/llvm-clang-x86_64-gcc-ubuntu/build/bin/clang -cc1 -internal-isystem /home/buildbot/buildbot-root/llvm-clang-x86_64-gcc-ubuntu/build/lib/clang/20/include -nostdsysteminc -verify -std=c2y -Wall -pedantic -ffreestanding /home/buildbot/buildbot-root/llvm-clang-x86_64-gcc-ubuntu/llvm-project/clang/test/C/C2y/n3346.c
+ /home/buildbot/buildbot-root/llvm-clang-x86_64-gcc-ubuntu/build/bin/clang -cc1 -internal-isystem /home/buildbot/buildbot-root/llvm-clang-x86_64-gcc-ubuntu/build/lib/clang/20/include -nostdsysteminc -verify -std=c2y -Wall -pedantic -ffreestanding /home/buildbot/buildbot-root/llvm-clang-x86_64-gcc-ubuntu/llvm-project/clang/test/C/C2y/n3346.c
error: 'expected-error' diagnostics expected but not seen: 
  File /home/buildbot/buildbot-root/llvm-clang-x86_64-gcc-ubuntu/llvm-project/clang/test/C/C2y/n3346.c Line 52: array initializer must be an initializer list
error: 'expected-error' diagnostics seen but not expected: 
  File /home/buildbot/buildbot-root/llvm-clang-x86_64-gcc-ubuntu/llvm-project/clang/test/C/C2y/n3346.c Line 52: initializing wide char array with non-wide string literal
2 errors generated.

--

********************


@llvm-ci
Copy link
Collaborator

llvm-ci commented Nov 8, 2024

LLVM Buildbot has detected a new failure on builder llvm-clang-aarch64-darwin running on doug-worker-5 while building clang at step 6 "test-build-unified-tree-check-all".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/190/builds/9132

Here is the relevant piece of the build log for the reference
Step 6 (test-build-unified-tree-check-all) failure: test (failure)
******************** TEST 'Clang :: C/C2y/n3346.c' FAILED ********************
Exit Code: 1

Command Output (stderr):
--
RUN: at line 1: /Users/buildbot/buildbot-root/aarch64-darwin/build/bin/clang -cc1 -internal-isystem /Users/buildbot/buildbot-root/aarch64-darwin/build/lib/clang/20/include -nostdsysteminc -verify -std=c2y -Wall -pedantic -ffreestanding /Users/buildbot/buildbot-root/aarch64-darwin/llvm-project/clang/test/C/C2y/n3346.c
+ /Users/buildbot/buildbot-root/aarch64-darwin/build/bin/clang -cc1 -internal-isystem /Users/buildbot/buildbot-root/aarch64-darwin/build/lib/clang/20/include -nostdsysteminc -verify -std=c2y -Wall -pedantic -ffreestanding /Users/buildbot/buildbot-root/aarch64-darwin/llvm-project/clang/test/C/C2y/n3346.c
error: 'expected-error' diagnostics expected but not seen: 
  File /Users/buildbot/buildbot-root/aarch64-darwin/llvm-project/clang/test/C/C2y/n3346.c Line 52: array initializer must be an initializer list
error: 'expected-error' diagnostics seen but not expected: 
  File /Users/buildbot/buildbot-root/aarch64-darwin/llvm-project/clang/test/C/C2y/n3346.c Line 52: initializing wide char array with non-wide string literal
2 errors generated.

--

********************


@llvm-ci
Copy link
Collaborator

llvm-ci commented Nov 8, 2024

LLVM Buildbot has detected a new failure on builder clang-debian-cpp20 running on clang-debian-cpp20 while building clang at step 6 "test-build-unified-tree-check-all".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/108/builds/5730

Here is the relevant piece of the build log for the reference
Step 6 (test-build-unified-tree-check-all) failure: test (failure)
******************** TEST 'Clang :: C/C2y/n3346.c' FAILED ********************
Exit Code: 1

Command Output (stderr):
--
RUN: at line 1: /vol/worker/clang-debian-cpp20/clang-debian-cpp20/build/bin/clang -cc1 -internal-isystem /vol/worker/clang-debian-cpp20/clang-debian-cpp20/build/lib/clang/20/include -nostdsysteminc -verify -std=c2y -Wall -pedantic -ffreestanding /vol/worker/clang-debian-cpp20/clang-debian-cpp20/llvm-project/clang/test/C/C2y/n3346.c
+ /vol/worker/clang-debian-cpp20/clang-debian-cpp20/build/bin/clang -cc1 -internal-isystem /vol/worker/clang-debian-cpp20/clang-debian-cpp20/build/lib/clang/20/include -nostdsysteminc -verify -std=c2y -Wall -pedantic -ffreestanding /vol/worker/clang-debian-cpp20/clang-debian-cpp20/llvm-project/clang/test/C/C2y/n3346.c
error: 'expected-error' diagnostics expected but not seen: 
  File /vol/worker/clang-debian-cpp20/clang-debian-cpp20/llvm-project/clang/test/C/C2y/n3346.c Line 52: array initializer must be an initializer list
error: 'expected-error' diagnostics seen but not expected: 
  File /vol/worker/clang-debian-cpp20/clang-debian-cpp20/llvm-project/clang/test/C/C2y/n3346.c Line 52: initializing wide char array with non-wide string literal
2 errors generated.

--

********************


@llvm-ci
Copy link
Collaborator

llvm-ci commented Nov 8, 2024

LLVM Buildbot has detected a new failure on builder fuchsia-x86_64-linux running on fuchsia-debian-64-us-central1-a-1 while building clang at step 4 "annotate".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/11/builds/7873

Here is the relevant piece of the build log for the reference
Step 4 (annotate) failure: 'python ../llvm-zorg/zorg/buildbot/builders/annotated/fuchsia-linux.py ...' (failure)
...
[1344/1346] Linking CXX executable tools/clang/unittests/Tooling/ToolingTests
[1345/1346] Running the Clang regression tests
llvm-lit: /var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/llvm/utils/lit/lit/llvm/config.py:506: note: using clang: /var/lib/buildbot/fuchsia-x86_64-linux/build/llvm-build-bxcwguar/bin/clang
llvm-lit: /var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/llvm/utils/lit/lit/llvm/subst.py:126: note: Did not find clang-repl in /var/lib/buildbot/fuchsia-x86_64-linux/build/llvm-build-bxcwguar/bin:/var/lib/buildbot/fuchsia-x86_64-linux/build/llvm-build-bxcwguar/bin
llvm-lit: /var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/llvm/utils/lit/lit/llvm/config.py:506: note: using ld.lld: /var/lib/buildbot/fuchsia-x86_64-linux/build/llvm-build-bxcwguar/bin/ld.lld
llvm-lit: /var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/llvm/utils/lit/lit/llvm/config.py:506: note: using lld-link: /var/lib/buildbot/fuchsia-x86_64-linux/build/llvm-build-bxcwguar/bin/lld-link
llvm-lit: /var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/llvm/utils/lit/lit/llvm/config.py:506: note: using ld64.lld: /var/lib/buildbot/fuchsia-x86_64-linux/build/llvm-build-bxcwguar/bin/ld64.lld
llvm-lit: /var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/llvm/utils/lit/lit/llvm/config.py:506: note: using wasm-ld: /var/lib/buildbot/fuchsia-x86_64-linux/build/llvm-build-bxcwguar/bin/wasm-ld
-- Testing: 21449 tests, 60 workers --
Testing:  0.
FAIL: Clang :: C/C2y/n3346.c (1500 of 21449)
******************** TEST 'Clang :: C/C2y/n3346.c' FAILED ********************
Exit Code: 1

Command Output (stderr):
--
RUN: at line 1: /var/lib/buildbot/fuchsia-x86_64-linux/build/llvm-build-bxcwguar/bin/clang -cc1 -internal-isystem /var/lib/buildbot/fuchsia-x86_64-linux/build/llvm-build-bxcwguar/lib/clang/20/include -nostdsysteminc -verify -std=c2y -Wall -pedantic -ffreestanding /var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/clang/test/C/C2y/n3346.c
+ /var/lib/buildbot/fuchsia-x86_64-linux/build/llvm-build-bxcwguar/bin/clang -cc1 -internal-isystem /var/lib/buildbot/fuchsia-x86_64-linux/build/llvm-build-bxcwguar/lib/clang/20/include -nostdsysteminc -verify -std=c2y -Wall -pedantic -ffreestanding /var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/clang/test/C/C2y/n3346.c
error: 'expected-error' diagnostics expected but not seen: 
  File /var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/clang/test/C/C2y/n3346.c Line 52: array initializer must be an initializer list
error: 'expected-error' diagnostics seen but not expected: 
  File /var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/clang/test/C/C2y/n3346.c Line 52: initializing wide char array with non-wide string literal
2 errors generated.

--

********************
Testing:  0.. 10.. 20.. 30.. 40.. 50.. 60.. 70.. 80.. 90.. 
********************
Failed Tests (1):
  Clang :: C/C2y/n3346.c


Testing Time: 79.16s

Total Discovered Tests: 45561
  Skipped          :     8 (0.02%)
  Unsupported      :   874 (1.92%)
  Passed           : 44653 (98.01%)
  Expectedly Failed:    25 (0.05%)
  Failed           :     1 (0.00%)
FAILED: tools/clang/test/CMakeFiles/check-clang /var/lib/buildbot/fuchsia-x86_64-linux/build/llvm-build-bxcwguar/tools/clang/test/CMakeFiles/check-clang 
cd /var/lib/buildbot/fuchsia-x86_64-linux/build/llvm-build-bxcwguar/tools/clang/test && /usr/bin/python3.10 /var/lib/buildbot/fuchsia-x86_64-linux/build/llvm-build-bxcwguar/./bin/llvm-lit -sv --param USE_Z3_SOLVER=0 /var/lib/buildbot/fuchsia-x86_64-linux/build/llvm-build-bxcwguar/tools/clang/test
ninja: build stopped: subcommand failed.
['ninja', '-C', '/var/lib/buildbot/fuchsia-x86_64-linux/build/llvm-build-bxcwguar', 'check-llvm', 'check-clang', 'check-lld'] exited with return code 1.
@@@STEP_FAILURE@@@
Step 7 (check) failure: check (failure)
...
[1344/1346] Linking CXX executable tools/clang/unittests/Tooling/ToolingTests
[1345/1346] Running the Clang regression tests
llvm-lit: /var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/llvm/utils/lit/lit/llvm/config.py:506: note: using clang: /var/lib/buildbot/fuchsia-x86_64-linux/build/llvm-build-bxcwguar/bin/clang
llvm-lit: /var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/llvm/utils/lit/lit/llvm/subst.py:126: note: Did not find clang-repl in /var/lib/buildbot/fuchsia-x86_64-linux/build/llvm-build-bxcwguar/bin:/var/lib/buildbot/fuchsia-x86_64-linux/build/llvm-build-bxcwguar/bin
llvm-lit: /var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/llvm/utils/lit/lit/llvm/config.py:506: note: using ld.lld: /var/lib/buildbot/fuchsia-x86_64-linux/build/llvm-build-bxcwguar/bin/ld.lld
llvm-lit: /var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/llvm/utils/lit/lit/llvm/config.py:506: note: using lld-link: /var/lib/buildbot/fuchsia-x86_64-linux/build/llvm-build-bxcwguar/bin/lld-link
llvm-lit: /var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/llvm/utils/lit/lit/llvm/config.py:506: note: using ld64.lld: /var/lib/buildbot/fuchsia-x86_64-linux/build/llvm-build-bxcwguar/bin/ld64.lld
llvm-lit: /var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/llvm/utils/lit/lit/llvm/config.py:506: note: using wasm-ld: /var/lib/buildbot/fuchsia-x86_64-linux/build/llvm-build-bxcwguar/bin/wasm-ld
-- Testing: 21449 tests, 60 workers --
Testing:  0.
FAIL: Clang :: C/C2y/n3346.c (1500 of 21449)
******************** TEST 'Clang :: C/C2y/n3346.c' FAILED ********************
Exit Code: 1

Command Output (stderr):
--
RUN: at line 1: /var/lib/buildbot/fuchsia-x86_64-linux/build/llvm-build-bxcwguar/bin/clang -cc1 -internal-isystem /var/lib/buildbot/fuchsia-x86_64-linux/build/llvm-build-bxcwguar/lib/clang/20/include -nostdsysteminc -verify -std=c2y -Wall -pedantic -ffreestanding /var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/clang/test/C/C2y/n3346.c
+ /var/lib/buildbot/fuchsia-x86_64-linux/build/llvm-build-bxcwguar/bin/clang -cc1 -internal-isystem /var/lib/buildbot/fuchsia-x86_64-linux/build/llvm-build-bxcwguar/lib/clang/20/include -nostdsysteminc -verify -std=c2y -Wall -pedantic -ffreestanding /var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/clang/test/C/C2y/n3346.c
error: 'expected-error' diagnostics expected but not seen: 
  File /var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/clang/test/C/C2y/n3346.c Line 52: array initializer must be an initializer list
error: 'expected-error' diagnostics seen but not expected: 
  File /var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/clang/test/C/C2y/n3346.c Line 52: initializing wide char array with non-wide string literal
2 errors generated.

--

********************
Testing:  0.. 10.. 20.. 30.. 40.. 50.. 60.. 70.. 80.. 90.. 
********************
Failed Tests (1):
  Clang :: C/C2y/n3346.c


Testing Time: 79.16s

Total Discovered Tests: 45561
  Skipped          :     8 (0.02%)
  Unsupported      :   874 (1.92%)
  Passed           : 44653 (98.01%)
  Expectedly Failed:    25 (0.05%)
  Failed           :     1 (0.00%)
FAILED: tools/clang/test/CMakeFiles/check-clang /var/lib/buildbot/fuchsia-x86_64-linux/build/llvm-build-bxcwguar/tools/clang/test/CMakeFiles/check-clang 
cd /var/lib/buildbot/fuchsia-x86_64-linux/build/llvm-build-bxcwguar/tools/clang/test && /usr/bin/python3.10 /var/lib/buildbot/fuchsia-x86_64-linux/build/llvm-build-bxcwguar/./bin/llvm-lit -sv --param USE_Z3_SOLVER=0 /var/lib/buildbot/fuchsia-x86_64-linux/build/llvm-build-bxcwguar/tools/clang/test
ninja: build stopped: subcommand failed.
['ninja', '-C', '/var/lib/buildbot/fuchsia-x86_64-linux/build/llvm-build-bxcwguar', 'check-llvm', 'check-clang', 'check-lld'] exited with return code 1.
program finished with exit code 0
elapsedTime=1129.435500

@llvm-ci
Copy link
Collaborator

llvm-ci commented Nov 8, 2024

LLVM Buildbot has detected a new failure on builder llvm-x86_64-debian-dylib running on gribozavr4 while building clang at step 6 "test-build-unified-tree-check-clang".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/60/builds/12265

Here is the relevant piece of the build log for the reference
Step 6 (test-build-unified-tree-check-clang) failure: test (failure)
******************** TEST 'Clang :: C/C2y/n3346.c' FAILED ********************
Exit Code: 1

Command Output (stderr):
--
RUN: at line 1: /b/1/llvm-x86_64-debian-dylib/build/bin/clang -cc1 -internal-isystem /b/1/llvm-x86_64-debian-dylib/build/lib/clang/20/include -nostdsysteminc -verify -std=c2y -Wall -pedantic -ffreestanding /b/1/llvm-x86_64-debian-dylib/llvm-project/clang/test/C/C2y/n3346.c
+ /b/1/llvm-x86_64-debian-dylib/build/bin/clang -cc1 -internal-isystem /b/1/llvm-x86_64-debian-dylib/build/lib/clang/20/include -nostdsysteminc -verify -std=c2y -Wall -pedantic -ffreestanding /b/1/llvm-x86_64-debian-dylib/llvm-project/clang/test/C/C2y/n3346.c
error: 'expected-error' diagnostics expected but not seen: 
  File /b/1/llvm-x86_64-debian-dylib/llvm-project/clang/test/C/C2y/n3346.c Line 52: array initializer must be an initializer list
error: 'expected-error' diagnostics seen but not expected: 
  File /b/1/llvm-x86_64-debian-dylib/llvm-project/clang/test/C/C2y/n3346.c Line 52: initializing wide char array with non-wide string literal
2 errors generated.

--

********************


@llvm-ci
Copy link
Collaborator

llvm-ci commented Nov 8, 2024

LLVM Buildbot has detected a new failure on builder clang-x86_64-debian-fast running on gribozavr4 while building clang at step 6 "test-build-unified-tree-check-all".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/56/builds/11798

Here is the relevant piece of the build log for the reference
Step 6 (test-build-unified-tree-check-all) failure: test (failure)
******************** TEST 'Clang :: C/C2y/n3346.c' FAILED ********************
Exit Code: 1

Command Output (stderr):
--
RUN: at line 1: /b/1/clang-x86_64-debian-fast/llvm.obj/bin/clang -cc1 -internal-isystem /b/1/clang-x86_64-debian-fast/llvm.obj/lib/clang/20/include -nostdsysteminc -verify -std=c2y -Wall -pedantic -ffreestanding /b/1/clang-x86_64-debian-fast/llvm.src/clang/test/C/C2y/n3346.c
+ /b/1/clang-x86_64-debian-fast/llvm.obj/bin/clang -cc1 -internal-isystem /b/1/clang-x86_64-debian-fast/llvm.obj/lib/clang/20/include -nostdsysteminc -verify -std=c2y -Wall -pedantic -ffreestanding /b/1/clang-x86_64-debian-fast/llvm.src/clang/test/C/C2y/n3346.c
error: 'expected-error' diagnostics expected but not seen: 
  File /b/1/clang-x86_64-debian-fast/llvm.src/clang/test/C/C2y/n3346.c Line 52: array initializer must be an initializer list
error: 'expected-error' diagnostics seen but not expected: 
  File /b/1/clang-x86_64-debian-fast/llvm.src/clang/test/C/C2y/n3346.c Line 52: initializing wide char array with non-wide string literal
2 errors generated.

--

********************


@llvm-ci
Copy link
Collaborator

llvm-ci commented Nov 9, 2024

LLVM Buildbot has detected a new failure on builder premerge-monolithic-linux running on premerge-linux-1 while building clang at step 7 "test-build-unified-tree-check-all".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/153/builds/14136

Here is the relevant piece of the build log for the reference
Step 7 (test-build-unified-tree-check-all) failure: test (failure)
******************** TEST 'Clang :: C/C2y/n3346.c' FAILED ********************
Exit Code: 1

Command Output (stderr):
--
RUN: at line 1: /build/buildbot/premerge-monolithic-linux/build/bin/clang -cc1 -internal-isystem /build/buildbot/premerge-monolithic-linux/build/lib/clang/20/include -nostdsysteminc -verify -std=c2y -Wall -pedantic -ffreestanding /build/buildbot/premerge-monolithic-linux/llvm-project/clang/test/C/C2y/n3346.c
+ /build/buildbot/premerge-monolithic-linux/build/bin/clang -cc1 -internal-isystem /build/buildbot/premerge-monolithic-linux/build/lib/clang/20/include -nostdsysteminc -verify -std=c2y -Wall -pedantic -ffreestanding /build/buildbot/premerge-monolithic-linux/llvm-project/clang/test/C/C2y/n3346.c
error: 'expected-error' diagnostics expected but not seen: 
  File /build/buildbot/premerge-monolithic-linux/llvm-project/clang/test/C/C2y/n3346.c Line 52: array initializer must be an initializer list
error: 'expected-error' diagnostics seen but not expected: 
  File /build/buildbot/premerge-monolithic-linux/llvm-project/clang/test/C/C2y/n3346.c Line 52: initializing wide char array with non-wide string literal
2 errors generated.

--

********************


Groverkss pushed a commit to iree-org/llvm-project that referenced this pull request Nov 15, 2024
…5516)

This converts some undefined behaviors during initialization to instead
be constraint violations. Clang has always implemented these as
constraints, so no compiler changes were needed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c2y clang Clang issues not falling into any other category documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants