https://llvm.org/bugs/show_bug.cgi?id=26337
Bug ID: 26337 Summary: extern "C" void fun(struct dummy, struct foo) doesn't always work Product: clang Version: unspecified Hardware: PC OS: Windows NT Status: NEW Severity: normal Priority: P Component: -New Bugs Assignee: unassignedclangb...@nondot.org Reporter: hjl.to...@gmail.com CC: llvm-bugs@lists.llvm.org Classification: Unclassified On x86-64, I got [hjl@gnu-6 empty-1]$ cat emptya.c #include "empty.h" void fun(struct dummy d, struct foo f) { if (f.i1 != -1) __builtin_abort(); } [hjl@gnu-6 empty-1]$ cat empty.cc #include "empty.h" extern "C" void fun(struct dummy, struct foo); int main() { struct dummy d; struct foo f = { -1, -2, -3, -4, -5 }; fun(d, f); return 0; } [hjl@gnu-6 empty-1]$ cat empty.h #ifdef __x86_64__ # ifndef PAD_SIZE # define PAD_SIZE 16 # endif struct dummy0 { }; struct dummy { struct dummy0 d[PAD_SIZE]; }; #else # ifndef PAD_SIZE struct dummy { }; # else struct dummy0 { }; struct dummy { struct dummy0 d[1]; }; # endif #endif struct foo { int i1; int i2; int i3; int i4; int i5; }; [hjl@gnu-6 empty-1]$ make /export/build/gnu/llvm-clang/build-x86_64-linux/bin/clang -m32 -c -O emptya.c /export/build/gnu/llvm-clang/build-x86_64-linux/bin/clang++ -m32 -c -O empty.cc /export/build/gnu/llvm-clang/build-x86_64-linux/bin/clang -m32 -o x emptya.o empty.o /export/build/gnu/llvm-clang/build-x86_64-linux/bin/clang -m32 -c -O -o empty1a.o emptya.c -DPAD_SIZE=17 /export/build/gnu/llvm-clang/build-x86_64-linux/bin/clang++ -m32 -c -O -o empty1.o empty.cc -DPAD_SIZE=17 /export/build/gnu/llvm-clang/build-x86_64-linux/bin/clang -m32 -o y empty1a.o empty1.o ./x ./y Makefile:17: recipe for target 'all' failed make: *** [all] Aborted [hjl@gnu-6 empty-1]$ make /export/build/gnu/llvm-clang/build-x86_64-linux/bin/clang -c -O emptya.c /export/build/gnu/llvm-clang/build-x86_64-linux/bin/clang++ -c -O empty.cc /export/build/gnu/llvm-clang/build-x86_64-linux/bin/clang -o x emptya.o empty.o /export/build/gnu/llvm-clang/build-x86_64-linux/bin/clang -c -O -o empty1a.o emptya.c -DPAD_SIZE=17 /export/build/gnu/llvm-clang/build-x86_64-linux/bin/clang++ -c -O -o empty1.o empty.cc -DPAD_SIZE=17 /export/build/gnu/llvm-clang/build-x86_64-linux/bin/clang -o y empty1a.o empty1.o ./x ./y Makefile:17: recipe for target 'all' failed make: *** [all] Aborted [hjl@gnu-6 empty-1]$ -- You are receiving this mail because: You are on the CC list for the bug.
_______________________________________________ llvm-bugs mailing list llvm-bugs@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs