blob: 860b50ff5852e498f2c0609f6692b20b7c525f40 [file] [log] [blame]
Justin Holewinski9903e942012-07-11 15:34:55 +00001// RUN: %clang_cc1 -triple nvptx-unknown-unknown -O3 -S -o - %s -emit-llvm | FileCheck %s
2// RUN: %clang_cc1 -triple nvptx64-unknown-unknown -O3 -S -o - %s -emit-llvm | FileCheck %s
3
4int bar(int a) {
5 int result;
6 // CHECK: call i32 asm sideeffect "{ {{.*}}
7 asm __volatile__ ("{ \n\t"
8 ".reg .pred \t%%p1; \n\t"
9 ".reg .pred \t%%p2; \n\t"
10 "setp.ne.u32 \t%%p1, %1, 0; \n\t"
11 "vote.any.pred \t%%p2, %%p1; \n\t"
12 "selp.s32 \t%0, 1, 0, %%p2; \n\t"
13 "}" : "=r"(result) : "r"(a));
14 return result;
15}