Issue 80929
Summary [C] error: unexpected token in argument list (target datalayout)
Labels new issue
Assignees
Reporter alejandro-colomar
    When trying to compile with Clang some library that I'm writing, I get this error:

```
$ make .tmp/a2i/a2i.c.o CC=clang --debug=print
CC (cpp)	.tmp/a2i/a2i.c.i
clang -I./include -I.tmp  -O3 -std=gnu11 -flto -Wall -Wextra -Wstrict-prototypes -Wdeclaration-after-statement -Wno-attributes -Wno-nullability-completeness -Wno-unknown-attributes -Wno-unknown-pragmas -Wno-unused-command-line-argument          -E -o .tmp/a2i/a2i.c.i .tmp/a2i/a2i.c
CC		.tmp/a2i/a2i.c.s
clang -I./include  -I.tmp  -O3 -std=gnu11 -flto -Wall -Wextra -Wstrict-prototypes -Wdeclaration-after-statement -Wno-attributes -Wno-nullability-completeness -Wno-unknown-attributes -Wno-unknown-pragmas -Wno-unused-command-line-argument          -S -o .tmp/a2i/a2i.c.s .tmp/a2i/a2i.c
CC (as)		.tmp/a2i/a2i.c.o
clang -I./include  -I.tmp -O3 -std=gnu11 -flto -Wall -Wextra -Wstrict-prototypes -Wdeclaration-after-statement -Wno-attributes -Wno-nullability-completeness -Wno-unknown-attributes -Wno-unknown-pragmas -Wno-unused-command-line-argument          -c -o .tmp/a2i/a2i.c.o .tmp/a2i/a2i.c.s
.tmp/a2i/a2i.c.s:1:14: error: missing _expression_
; ModuleID = '.tmp/a2i/a2i.c'
             ^
.tmp/a2i/a2i.c.s:3:19: error: unexpected token in argument list
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
 ^
.tmp/a2i/a2i.c.s:4:15: error: unexpected token in argument list
target triple = "x86_64-pc-linux-gnu"
 ^
.tmp/a2i/a2i.c.s:6:17: error: unexpected token in argument list
; Function Attrs: inlinehint nounwind uwtable
 ^
.tmp/a2i/a2i.c.s:7:18: error: unexpected token in argument list
define dso_local i32 @a2shh(ptr noalias nocapture noundef writeonly %0, ptr noundef %1, ptr noalias noundef %2, i32 noundef %3, i8 noundef signext %4, i8 noundef signext %5) local_unnamed_addr #0 {
 ^
```

Is it maybe due to some CFLAGS?  I wouldn't suspect of the code, but can share it if you want to see it.

Cc: @thesamesam 
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to