https://bugs.llvm.org/show_bug.cgi?id=51344

            Bug ID: 51344
           Summary: Can't compile C std= for nvptx64
           Product: OpenMP
           Version: unspecified
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Clang Compiler Support
          Assignee: unassignedclangb...@nondot.org
          Reporter: jonathanchesterfi...@gmail.com
                CC: llvm-bugs@lists.llvm.org

int main() {}

clang -std=c99 -fopenmp -fopenmp-targets=nvptx64-nvidia-cuda

opt/compiler-explorer/clang-trunk-20210804/lib/clang/14.0.0/include/__clang_cuda_device_functions.h:40:63:
error: use of undeclared identifier 'asm'
__DEVICE__ void __attribute__((overloadable)) __brkpt(void) { asm
volatile("brkpt;"); }

https://godbolt.org/z/9TMc9oPMW

That would be because 'asm' is a gnu extension and I passed std=c99.

Clang accepts __asm or __asm__ when the header is included in openmp. As far as
I can tell, cuda accepts all three.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to