llvm-project/clang/test/Misc/wrong-encoding.c
Aaron Ballman 7de7161304 Use functions with prototypes when appropriate; NFC
A significant number of our tests in C accidentally use functions
without prototypes. This patch converts the function signatures to have
a prototype for the situations where the test is not specific to K&R C
declarations. e.g.,

  void func();

becomes

  void func(void);

This is the sixth batch of tests being updated (there are a significant
number of other tests left to be updated).
2022-02-09 17:16:10 -05:00

40 lines
969 B
C
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

// RUN: %clang_cc1 -fsyntax-only -Wno-unused-value %s 2>&1 | FileCheck -strict-whitespace %s
// REQUIRES: asserts
void foo(void) {
"§Ã"; // ø
// CHECK: {{^ "<A7><C3>"; // <F8>}}
// CHECK: {{^ \^~~~~~~}}
/* þ« */ const char *d = "¥";
// CHECK: {{^ /\* <FE><AB> \*/ const char \*d = "<A5>";}}
// CHECK: {{^ \^~~~}}
"xxé¿¿¿d";
// CHECK: {{^ "xx<U\+9FFF><BF>d";}}
// CHECK: {{^ \^~~~}}
"xxé¿bcd";
// CHECK: {{^ "xx<E9><BF>bcd";}}
// CHECK: {{^ \^~~~~~~~}}
"xxéabcd";
// CHECK: {{^ "xx<E9>abcd";}}
// CHECK: {{^ \^~~~}}
"xxé¿é¿d";
// CHECK: {{^ "xx<E9><BF><E9><BF>d";}}
// CHECK: {{^ \^~~~~~~~~~~~~~~}}
"xxé¿xxxxxxxxxxxxxxxxxxxxxé¿xx";
// CHECK: {{^ "xx<E9><BF>xxxxxxxxxxxxxxxxxxxxx<E9><BF>xx";}}
// CHECK: {{^ \^~~~~~~~ ~~~~~~~~}}
"<EFBFBD>?kÍS¥ÇØg<C398>7†, 2,Díu„†*É,pûäÚ&”‰(<28>K§:Ñ'1áÎjOŰ<:";
"xé¿xé¿xé¿xé¿xé¿xé¿xé¿xé¿xé¿xé¿xé¿xé¿x";
}
// CHECK-NOT:Assertion